diff --git a/menu/additional_apps.sh b/menu/additional_apps.sh index 4708424f..49767e77 100644 --- a/menu/additional_apps.sh +++ b/menu/additional_apps.sh @@ -30,7 +30,6 @@ choice=$(whiptail --title "$TITLE" --checklist "Which apps do you want to instal "Documentserver" "(OnlyOffice or Collabora - Docker or Integrated)" OFF \ "Bitwarden" "(External password manager)" OFF \ "Fail2ban " "(Extra Bruteforce protection)" "$STARTUP_SWITCH" \ -"Fail2ban Statuscheck" "(Check status of banned IPs in iptables and Fail2ban)" OFF \ "Adminer" "(PostgreSQL GUI)" OFF \ "Netdata" "(Real-time server monitoring in Web GUI)" OFF \ "BPYTOP" "(Real-time server monitoring in CLI)" OFF \ @@ -55,17 +54,7 @@ case "$choice" in *"Fail2ban "*) clear print_text_in_color "$ICyan" "Downloading the Fail2ban script..." - run_script APP fail2ban - ;;& - *"Fail2ban Statuscheck"*) - clear - SUBTITLE="Fail2ban Statuscheck" - if is_this_installed fail2ban && [ -f "/etc/fail2ban/filter.d/nextcloud.conf" ] - then - msg_box "$(fail2ban-client status nextcloud && fail2ban-client status sshd && iptables -L -n)" "$SUBTITLE" - else - msg_box "Fail2ban isn't installed. Please run 'sudo bash /var/scripts/menu.sh' to install it." "$SUBTITLE" - fi + run_script MENU fail2ban_menu ;;& *"Adminer"*) clear @@ -124,7 +113,7 @@ case "$choice" in *"Talk"*) clear print_text_in_color "$ICyan" "Downloading the Talk script..." - run_script APP talk_signaling + run_script MENU talk_menu ;;& *"Webmin"*) clear diff --git a/menu/fail2ban_menu.sh b/menu/fail2ban_menu.sh new file mode 100644 index 00000000..6b8e6837 --- /dev/null +++ b/menu/fail2ban_menu.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/ + +# shellcheck disable=2034,2059 +true +SCRIPT_NAME="Fail2ban Menu" +# shellcheck source=lib.sh +. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh) + +# Check for errors + debug code and abort if something isn't right +# 1 = ON +# 0 = OFF +DEBUG=0 +debug_mode + +# Must be root +root_check + +# Set the startup switch +if [ -f "$SCRIPTS/nextcloud-startup-script.sh" ] +then + STARTUP_SWITCH="ON" +else + STARTUP_SWITCH="OFF" +fi + +choice=$(whiptail --title "$TITLE" --checklist "Automatically install and configure Fail2ban.\n$CHECKLIST_GUIDE\n$MENU_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \ +"Install-Fail2ban" "(Install Fail2ban and protect Nextcloud + SSH)" "$STARTUP_SWITCH" \ +"Fail2ban-Statuscheck" "(Check status of currently blocked attacks)" OFF 3>&1 1>&2 2>&3) + +case "$choice" in + *"Install-Fail2ban"*) + clear + print_text_in_color "$ICyan" "Downloading the Fail2ban install script..." + run_script APP fail2ban + ;;& + *"Fail2ban-Statuscheck"*) + clear + SUBTITLE="Fail2ban Statuscheck" + if is_this_installed fail2ban && [ -f "/etc/fail2ban/filter.d/nextcloud.conf" ] + then + msg_box "$(fail2ban-client status nextcloud && fail2ban-client status sshd && iptables -L -n)" "$SUBTITLE" + else + msg_box "Fail2ban isn't installed. Please run 'sudo bash /var/scripts/menu.sh' to install it." "$SUBTITLE" + fi + ;;& + *) + ;; +esac +exit + diff --git a/menu/talk_menu.sh b/menu/talk_menu.sh new file mode 100644 index 00000000..6299dcbb --- /dev/null +++ b/menu/talk_menu.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/ + +# shellcheck disable=2034,2059 +true +SCRIPT_NAME="Talk Menu" +# shellcheck source=lib.sh +. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh) + +# Check for errors + debug code and abort if something isn't right +# 1 = ON +# 0 = OFF +DEBUG=0 +debug_mode + +# Must be root +root_check + +# Set the startup switch +if [ -f "$SCRIPTS/nextcloud-startup-script.sh" ] +then + STARTUP_SWITCH="ON" +else + STARTUP_SWITCH="OFF" +fi + +choice=$(whiptail --title "$TITLE" --checklist "Automatically install and configure Talk.\n$CHECKLIST_GUIDE\n$MENU_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \ +"Talk " "(Install Talk standalone - no subdomain required)" OFF \ +"Talk-Signaling" "(Install Talk + Signaling Server - subdomain required)" OFF 3>&1 1>&2 2>&3) + +case "$choice" in + *"Talk "*) + clear + print_text_in_color "$ICyan" "Downloading the Talk script..." + run_script APP talk + ;;& + *"Talk-Signaling"*) + clear + print_text_in_color "$ICyan" "Downloading the Talk Signaling script..." + run_script APP talk_signaling + ;;& + *) + ;; +esac +exit +