change order of server_configuration and automatically set the activate_tls_switch (#1422)

* address review

Co-authored-by: Daniel Hansson <github@hanssonit.se>
This commit is contained in:
szaimen 2020-09-09 10:09:19 +02:00 committed by GitHub
parent dc94865d18
commit abc39f3a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,41 +17,39 @@ debug_mode
# Must be root
root_check
# Set the correct switch for activate_tls
if [ -f $SCRIPTS/activate-tls.sh ]
then
ACTIVATE_TLS_SWITCH="ON"
else
ACTIVATE_TLS_SWITCH="OFF"
fi
# Server configurations
choice=$(whiptail --title "$TITLE" --checklist "Choose what you want to configure\n$CHECKLIST_GUIDE\n$MENU_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
"Activate TLS" "(Enable HTTPS with Let's Encrypt)" ON \
"Security" "(Add extra security based on this http://goo.gl/gEJHi7)" OFF \
"Static IP" "(Set static IP in Ubuntu with netplan.io)" OFF \
"Security" "(Add extra security based on this http://goo.gl/gEJHi7)" OFF \
"DDclient Configuration" "(Use ddclient for automatic DDNS updates)" OFF \
"Activate TLS" "(Enable HTTPS with Let's Encrypt)" "$ACTIVATE_TLS_SWITCH" \
"Automatic updates" "(Automatically update your server every week on Sundays)" OFF \
"Disk Check" "(Check for S.M.A.R.T errors on your disks every week on Mondays)" OFF 3>&1 1>&2 2>&3)
case "$choice" in
*"Security"*)
clear
print_text_in_color "$ICyan" "Downloading the Security script..."
run_script ADDONS security
;;&
*"Static IP"*)
clear
print_text_in_color "$ICyan" "Downloading the Static IP script..."
run_script NETWORK static_ip
;;&
*"Security"*)
clear
print_text_in_color "$ICyan" "Downloading the Security script..."
run_script ADDONS security
;;&
*"DDclient Configuration"*)
clear
print_text_in_color "$ICyan" "Downloading the DDclient Configuration script..."
run_script NETWORK ddclient-configuration
;;&
*"Automatic updates"*)
clear
print_text_in_color "$ICyan" "Downloading the Automatic Updates script..."
run_script ADDONS automatic_updates
;;&
*"Disk Check"*)
clear
print_text_in_color "$ICyan" "Downloading the Disk Check script..."
run_script DISK smartctl
;;&
*"Activate TLS"*)
clear
msg_box "The following script will install a trusted
@ -76,12 +74,21 @@ https://www.techandme.se/open-port-80-443/"
print_text_in_color "$ICyan" "OK, but if you want to run it later, just type: sudo bash $SCRIPTS/activate-tls.sh"
any_key "Press any key to continue..."
fi
# Just make sure they are gone
# Just make sure it is gone
rm -f "$SCRIPTS/test-new-config.sh"
rm -f "$SCRIPTS/activate-tls.sh"
clear
;;&
*"Automatic updates"*)
clear
print_text_in_color "$ICyan" "Downloading the Automatic Updates script..."
run_script ADDONS automatic_updates
;;&
*"Disk Check"*)
clear
print_text_in_color "$ICyan" "Downloading the Disk Check script..."
run_script DISK smartctl
;;&
*)
;;
esac