mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
nextcloudpi-config visual rework. also, included in raspi-config
This commit is contained in:
parent
fcda8f8643
commit
d2030a7414
@ -19,7 +19,7 @@ DOMAIN_=mycloud.ownyourbits.com
|
||||
IP_=127.0.0.1
|
||||
DNSSERVER_=8.8.8.8
|
||||
CACHESIZE_=150
|
||||
DESCRIPTION="dnsmasq: DNS server with cache"
|
||||
DESCRIPTION="DNS server with cache"
|
||||
|
||||
install()
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ FINDTIME_=600
|
||||
# bad attempts before banning an IP
|
||||
MAXRETRY_=6
|
||||
|
||||
DESCRIPTION="fail2ban: Brute force protection for SSH and NextCloud"
|
||||
DESCRIPTION="Brute force protection for SSH and NextCloud"
|
||||
|
||||
install()
|
||||
{
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
DOMAIN_=mycloud.ownyourbits.com
|
||||
EMAIL_=mycloud@ownyourbits.com
|
||||
VHOSTCFG_=/etc/apache2/sites-available/nextcloud.conf
|
||||
DESCRIPTION="Let's Encrypt: automatic signed SSL certificates"
|
||||
DESCRIPTION="Automatic signed SSL certificates"
|
||||
|
||||
install()
|
||||
{
|
||||
|
||||
27
library.sh
27
library.sh
@ -153,7 +153,7 @@ function config()
|
||||
while test $RET != 1 && test $RET != 250; do
|
||||
local value
|
||||
value=$( dialog --ok-label "Start" \
|
||||
--backtitle "$BACKTITLE" \
|
||||
--no-lines --backtitle "$BACKTITLE" \
|
||||
--form "Enter the desired configuration for $( basename "$INSTALL_SCRIPT" .sh )" \
|
||||
20 70 0 $PARAM \
|
||||
3>&1 1>&2 2>&3 )
|
||||
@ -162,7 +162,7 @@ function config()
|
||||
case $RET in
|
||||
$DIALOG_CANCEL)
|
||||
dialog \
|
||||
--clear \
|
||||
--no-lines --clear \
|
||||
--backtitle "$BACKTITLE" \
|
||||
--yesno "Really quit?" 10 30
|
||||
case $? in
|
||||
@ -176,23 +176,12 @@ function config()
|
||||
esac
|
||||
;;
|
||||
$DIALOG_OK)
|
||||
dialog \
|
||||
--clear \
|
||||
--backtitle "$BACKTITLE" --no-collapse --cr-wrap \
|
||||
--yesno "The following configuration will be used\n\n$value" 10 60
|
||||
case $? in
|
||||
$DIALOG_OK)
|
||||
local RET=( $value )
|
||||
for i in `seq 0 1 $(( ${#RET[@]} - 1 )) `; do
|
||||
local SEDRULE+="s|^${VARS[$i]}_=.*|${VARS[$i]}_=${RET[$i]}|;"
|
||||
local CONFIG+="${VARS[$i]}=${RET[$i]}\n"
|
||||
done
|
||||
break
|
||||
;;
|
||||
$DIALOG_CANCEL)
|
||||
RET=99
|
||||
;;
|
||||
esac
|
||||
local RET=( $value )
|
||||
for i in `seq 0 1 $(( ${#RET[@]} - 1 )) `; do
|
||||
local SEDRULE+="s|^${VARS[$i]}_=.*|${VARS[$i]}_=${RET[$i]}|;"
|
||||
local CONFIG+="${VARS[$i]}=${RET[$i]}\n"
|
||||
done
|
||||
break
|
||||
;;
|
||||
$DIALOG_ERROR)
|
||||
echo "ERROR!$value"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
ACTIVE_=no
|
||||
NCDIR_=/var/www/nextcloud/
|
||||
DESCRIPTION="modsecurity: Web Application Firewall for extra security (experimental)"
|
||||
DESCRIPTION="Web Application Firewall for extra security (experimental)"
|
||||
|
||||
install()
|
||||
{
|
||||
|
||||
@ -230,6 +230,8 @@ EOF
|
||||
# NEXTCLOUDPI-CONFIG
|
||||
$APTINSTALL dialog
|
||||
mkdir -p $CONFDIR
|
||||
sed -i '/Change User Password/i"0 NextCloudPi Configuration" "Configuration of NextCloudPi" \\' /usr/bin/raspi-config
|
||||
sed -i '/1\\ \*) do_change_pass ;;/i0\\ *) nextcloudpi-config ;;' /usr/bin/raspi-config
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@ -25,9 +25,11 @@ function nextcloud-config()
|
||||
LIST+=( $( basename $item .sh ) "$DESC" )
|
||||
done
|
||||
local script
|
||||
script=$( dialog --notags --backtitle "NextCloudPi configuration" \
|
||||
--menu "Select program to configure and activate:" 20 80 10 \
|
||||
"${LIST[@]}" \
|
||||
script=$( whiptail --backtitle "NextCloudPi configuration" \
|
||||
--title "NextCloudPi Software Configuration Tool (nextcloudpi-config)" \
|
||||
--cancel-button Finish --ok-button Select \
|
||||
--menu "Select program to configure and activate:" 20 100 10 \
|
||||
"${LIST[@]}" \
|
||||
3>&1 1>&2 2>&3 )
|
||||
|
||||
[[ $? -ne $DIALOG_OK ]] || [[ "$script" == "" ]] && return 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user