small fixes

This commit is contained in:
buanet
2022-09-19 21:54:57 +02:00
parent 15da4a272d
commit 3e40d2acd1
3 changed files with 38 additions and 4 deletions

View File

@@ -1,8 +1,10 @@
## Changelog
### v7.1.0-beta.1 (coming soon)
* testing strict mode for iobroker-startup.sh
* fixing "unary operator expected" error
* add restart option to maintenance script
* enhance logging
* test strict mode for iobroker-startup.sh
* fix "unary operator expected" error
### v7.0.1 (05.07.2022)
* backitup restore patch

View File

@@ -37,8 +37,8 @@ echo -n "$(printf -- '-%.0s' {1..25})" && echo -n " "$dati" " && echo "
echo "$(printf -- '-%.0s' {1..80})"
echo ' '
echo "$(printf -- '-%.0s' {1..80})"
echo "----- Welcome to your ioBroker-container! -----"
echo "----- Startupscript is now running. -----"
echo "----- Welcome to your ioBroker Docker container! -----"
echo "----- Startupscript is now running! -----"
echo "----- Please be patient! -----"
echo "$(printf -- '-%.0s' {1..80})"
echo ' '
@@ -486,6 +486,7 @@ echo "$(printf -- '-%.0s' {1..80})"
echo ' '
echo "Starting ioBroker..."
echo ' '
echo "##### #### ### ## # iobroker.js-controller log output # ## ### #### #####"
# Setting healthcheck status to "running"
echo "running" > /opt/scripts/.docker_config/.healthcheck

View File

@@ -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
;;