mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-18 19:09:02 +02:00
small fixes
This commit is contained in:
31
debian/scripts/maintenance.sh
vendored
31
debian/scripts/maintenance.sh
vendored
@@ -22,6 +22,7 @@ display_help() {
|
||||
echo ' on > switches mantenance mode ON'
|
||||
echo ' off > switches mantenance mode OFF and stops or restarts the container'
|
||||
echo ' upgrade > puts the container to maintenance mode and upgrades ioBroker'
|
||||
echo ' restart > stops iobroker and stops or restarts the container'
|
||||
echo ' help > shows this help'
|
||||
echo ''
|
||||
echo 'OPTIONS'
|
||||
@@ -157,6 +158,33 @@ upgrade_jscontroller() {
|
||||
pkill -u root
|
||||
}
|
||||
|
||||
# restart container
|
||||
restart_container() {
|
||||
echo 'You are now going to call a restart of your container.'
|
||||
echo 'Restarting will work depending on the configured restart policy.'
|
||||
|
||||
if [[ "$autoconfirm" != yes ]]; then
|
||||
local reply
|
||||
|
||||
read -rp 'Do you want to continue [yes/no]? ' reply
|
||||
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
|
||||
: # continue
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
echo 'This command was already confirmed by the -y or --yes option.'
|
||||
fi
|
||||
|
||||
echo -n 'Stopping ioBroker...'
|
||||
stop_iob
|
||||
|
||||
echo 'Container will be stopped or restarted in 5 seconds...'
|
||||
sleep 5
|
||||
echo 'stopping' > "$healthcheck"
|
||||
pkill -u root
|
||||
}
|
||||
|
||||
# stop iobroker and wait until all processes stopped or pkill_timeout is reached
|
||||
stop_iob() {
|
||||
local status timeout
|
||||
@@ -211,6 +239,9 @@ for arg in "$@"; do
|
||||
upgrade)
|
||||
run=(upgrade_jscontroller)
|
||||
;;
|
||||
restart)
|
||||
run=(restart_container)
|
||||
;;
|
||||
-y|--yes)
|
||||
autoconfirm=yes
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user