mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-23 21:25:33 +02:00
Merge pull request #229 from thost96/patch-1
added autoconfirm for upgrade
This commit is contained in:
28
debian/scripts/maintenance.sh
vendored
28
debian/scripts/maintenance.sh
vendored
@@ -130,6 +130,8 @@ switch_off() {
|
||||
|
||||
# upgrade js-controller
|
||||
upgrade() {
|
||||
if [ "$autoconfirm" == "no" ]
|
||||
then
|
||||
echo 'You are now going to upgrade your js-controller.'
|
||||
echo 'As this will change data in /opt/iobroker, make sure you have a backup!'
|
||||
echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.'
|
||||
@@ -158,6 +160,32 @@ upgrade() {
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
elif [ "$autoconfirm" == "yes" ]
|
||||
then
|
||||
echo 'You are now going to upgrade your js-controller.'
|
||||
echo 'As this will change data in /opt/iobroker, make sure you have a backup!'
|
||||
echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.'
|
||||
echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.'
|
||||
echo 'This command was already confirmed by -y or --yes option.'
|
||||
echo 'Activating maintenance mode...'
|
||||
echo "maintenance" > /opt/scripts/.docker_config/.healthcheck
|
||||
sleep 1
|
||||
echo 'Done.'
|
||||
echo 'Stopping ioBroker...'
|
||||
pkill -u iobroker
|
||||
sleep 1
|
||||
echo 'Done.'
|
||||
echo 'Upgrading js-controller...'
|
||||
iobroker update
|
||||
iobroker upgrade self
|
||||
sleep 1
|
||||
echo 'Done.'
|
||||
echo 'Container will be stopped/ restarted in 5 seconds...'
|
||||
sleep 5
|
||||
echo "stopping" > /opt/scripts/.docker_config/.healthcheck
|
||||
pkill -u root
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
########################################
|
||||
|
||||
Reference in New Issue
Block a user