diff --git a/CHANGELOG.md b/CHANGELOG.md index 634ddfe..32ac949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Changelog ### v5.2.0-beta3 (2021-09-04) +* changes for backitup compatibility * reducing layers in dockerfile * making hostname check mandatory for startup * optimize startup log diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index 6d384db..a02a60a 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -5,6 +5,7 @@ ############################ autoconfirm=no # could be set to true by commandline option +killbyname=no # could be set to true by commandline option / undocumented, only for use with backitup restore scripts #################################### ##### declaration of functions ##### @@ -46,7 +47,19 @@ check_status() { # turn maintenance mode ON switch_on() { - if [ $(cat /opt/scripts/.docker_config/.healthcheck) != 'maintenance' ] && [ "$autoconfirm" == "no" ] # maintenance mode OFF / autoconfirm = no + if [ $(cat /opt/scripts/.docker_config/.healthcheck) != 'maintenance' ] && [ "$killbyname" == "yes" ] # maintenance mode OFF / killbyname = yes / undocumented, only for use with backitup restore scripts + then + echo 'This command will activate maintenance mode and stop all node processes.' + echo 'Activating maintenance mode...' + echo "maintenance" > /opt/scripts/.docker_config/.healthcheck + sleep 1 + echo 'Done.' + echo 'Stopping ioBroker...' + pkill node + sleep 1 + echo 'Done.' + exit 0 + elif [ $(cat /opt/scripts/.docker_config/.healthcheck) != 'maintenance' ] && [ "$autoconfirm" == "no" ] # maintenance mode OFF / autoconfirm = no then echo 'You are now going to stop ioBroker and activating maintenance mode for this container.' read -p 'Do you want to continue [yes/no]? ' A @@ -183,6 +196,10 @@ for i in $reverse; do autoconfirm=yes # setting autoconfrm option to "yes" shift ;; + -kbn|--killbyname) + killbyname=yes # setting killbyname option to "yes" + shift + ;; -a=*|--argument=*) # dummy exaple for parsing option with value ARGUMENT="${i#*=}" shift