first test of gui for maintenance script

This commit is contained in:
buanet
2023-12-14 17:17:49 +01:00
parent d1bbbfff58
commit c0ea8c2808

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
welcome () {
whiptail --title "ioBroker Docker Container Maintenance Script" --ok-button "OK" --msgbox " \
╔═══════════════════════════════════════════════════════════════════════╗\
\n ║ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗ ███████╗ ██████╗ ║\
\n ║ ██║ ██╔═══██╗ ██╔══██╗ ██╔══██╗ ██╔═══██╗ ██║ ██╔╝ ██╔════╝ ██╔══██╗ ║\
\n ║ ██║ ██║ ██║ ██████╔╝ ██████╔╝ ██║ ██║ █████╔╝ █████╗ ██████╔╝ ║\
\n ║ ██║ ██║ ██║ ██╔══██╗ ██╔══██╗ ██║ ██║ ██╔═██╗ ██╔══╝ ██╔══██╗ ║\
\n ║ ██║ ╚██████╔╝ ██████╔╝ ██║ ██║ ╚██████╔╝ ██║ ██╗ ███████╗ ██║ ██║ ║\
\n ║ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ║\
\n ╚═══════════════════════════════════════════════════════════════════════╝\
\n This script will help you to maintain your ioBroker Docker container!\
\n" 19 79
}
if welcome; then
TO_RUN=$(whiptail --title "ioBroker Docker Container Maintenance Script" --menu "What do you want to do?" 25 78 5 \
"maintenance" "Turn Maintenance Mode on or off" \
"upgrade" "Upgrade js-controller" \
"restore" "Restore ioBroker from backup" 3>&1 1>&2 2>&3)
else
exit 0
fi
if [[ $TO_RUN = "maintenance" ]]; then
echo "You selected maintenance"
elif [[ $TO_RUN = "upgrade" ]]; then
echo "You selected upgrade"
elif [[ $TO_RUN = "restore" ]]; then
echo "You selected restore"
fi