diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-03-24 20:20:38 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-03-24 20:20:38 +0300 |
commit | d2030a74140d4420572aeedfe06958898d31920f (patch) | |
tree | c6e800c1c59aa4e1a70f9375b8109dc1aace6712 | |
parent | fcda8f864346130ccb9fa9ded829335f1289b9ae (diff) |
nextcloudpi-config visual rework. also, included in raspi-config
-rwxr-xr-x | dnsmasq.sh | 2 | ||||
-rwxr-xr-x | fail2ban.sh | 2 | ||||
-rwxr-xr-x | letsencrypt.sh | 2 | ||||
-rwxr-xr-x | library.sh | 27 | ||||
-rwxr-xr-x | modsecurity.sh | 2 | ||||
-rwxr-xr-x | nextcloud.sh | 2 | ||||
-rwxr-xr-x | nextcloudpi-config | 8 | ||||
-rwxr-xr-x | no-ip.sh | 2 |
8 files changed, 20 insertions, 27 deletions
@@ -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() { diff --git a/fail2ban.sh b/fail2ban.sh index b5ff030e..758c78c0 100755 --- a/fail2ban.sh +++ b/fail2ban.sh @@ -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() { diff --git a/letsencrypt.sh b/letsencrypt.sh index 531acec1..29047843 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -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() { @@ -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" diff --git a/modsecurity.sh b/modsecurity.sh index a6627f3d..43639815 100755 --- a/modsecurity.sh +++ b/modsecurity.sh @@ -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() { diff --git a/nextcloud.sh b/nextcloud.sh index d5fd6211..d395552b 100755 --- a/nextcloud.sh +++ b/nextcloud.sh @@ -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 } diff --git a/nextcloudpi-config b/nextcloudpi-config index 6bf23433..a075c72a 100755 --- a/nextcloudpi-config +++ b/nextcloudpi-config @@ -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 @@ -19,7 +19,7 @@ ACTIVE_=yes USER_=my-noip-user@email.com PASS_=noip-pass TIME_=30 -DESCRIPTION="no-ip.org: free Dynamic DNS provider (need account)" +DESCRIPTION="Free Dynamic DNS provider (need account)" install() { |