mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-20 11:49:10 +02:00
added autoconfirm for upgrade
Added autoconfirm for upgrade to fix issue https://github.com/buanet/ioBroker.docker/issues/228
This commit is contained in:
committed by
GitHub
parent
95451d052f
commit
d4a31e2629
48
debian/scripts/maintenance.sh
vendored
48
debian/scripts/maintenance.sh
vendored
@@ -129,13 +129,43 @@ switch_off() {
|
|||||||
|
|
||||||
# upgrade js-controller
|
# upgrade js-controller
|
||||||
upgrade() {
|
upgrade() {
|
||||||
echo 'You are now going to upgrade your js-controller.'
|
if [ "$autoconfirm" == "no" ]
|
||||||
echo 'As this will change data in /opt/iobroker, make sure you have a backup!'
|
then
|
||||||
echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.'
|
echo 'You are now going to upgrade your js-controller.'
|
||||||
echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.'
|
echo 'As this will change data in /opt/iobroker, make sure you have a backup!'
|
||||||
read -p 'Do you want to continue [yes/no]? ' A
|
echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.'
|
||||||
if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ]
|
echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.'
|
||||||
then
|
read -p 'Do you want to continue [yes/no]? ' A
|
||||||
|
if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ]
|
||||||
|
then
|
||||||
|
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
|
||||||
|
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 'Activating maintenance mode...'
|
||||||
echo "maintenance" > /opt/scripts/.docker_config/.healthcheck
|
echo "maintenance" > /opt/scripts/.docker_config/.healthcheck
|
||||||
sleep 1
|
sleep 1
|
||||||
@@ -154,8 +184,6 @@ upgrade() {
|
|||||||
echo "stopping" > /opt/scripts/.docker_config/.healthcheck
|
echo "stopping" > /opt/scripts/.docker_config/.healthcheck
|
||||||
pkill -u root
|
pkill -u root
|
||||||
exit 0
|
exit 0
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,4 +246,4 @@ for i in $reverse; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user