nextcloudpi-config visual rework. also, included in raspi-config

This commit is contained in:
nachoparker 2017-03-24 18:20:38 +01:00
parent fcda8f8643
commit d2030a7414
8 changed files with 20 additions and 27 deletions

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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"

View File

@ -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()
{

View File

@ -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
}

View File

@ -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

View File

@ -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()
{