diff --git a/addons/automatic_updates.sh b/addons/automatic_updates.sh index 3c0f33fe30..906dbac994 100644 --- a/addons/automatic_updates.sh +++ b/addons/automatic_updates.sh @@ -42,7 +42,7 @@ mkdir -p "$VMLOGS"/updates crontab -u root -l | { cat; echo "0 $AUT_UPDATES_TIME * 1-12 6 $SCRIPTS/update.sh minor >> $VMLOGS/updates/update-\$(date +\%Y-\%m-\%d_\%H:\%M).log 2>&1"; } | crontab -u root - if yesno_box_yes "Do you want to reboot your server after every update? *recommended*" then - sed -i "s|exit|/sbin/shutdown -r +10|g" "$SCRIPTS"/update.sh + sed -i '$ s|^exit$|/sbin/shutdown -r +10|' "$SCRIPTS"/update.sh echo "exit" >> "$SCRIPTS"/update.sh fi diff --git a/menu/main_menu.sh b/menu/main_menu.sh index ec3d4a9265..574076b7d3 100644 --- a/menu/main_menu.sh +++ b/menu/main_menu.sh @@ -81,7 +81,7 @@ To upgrade to the latest version, please run: 'sudo bash $SCRIPTS/update.sh' fro download_script STATIC update if [ -n "$REBOOT_SET" ] then - sed -i "s|exit|/sbin/shutdown -r +10|g" "$SCRIPTS"/update.sh + sed -i '$ s|^exit$|/sbin/shutdown -r +10|' "$SCRIPTS"/update.sh fi do_the_update else diff --git a/nextcloud_update.sh b/nextcloud_update.sh index a8c829412f..c9df4cf766 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -276,7 +276,7 @@ chmod +x "$SCRIPTS"/update.sh # Restore reboot if it was enabled if [ "$REBOOT_ENABLED" = 1 ] then - sed -i "s|exit|/sbin/shutdown -r +10|g" "$SCRIPTS"/update.sh + sed -i '$ s|^exit$|/sbin/shutdown -r +10|' "$SCRIPTS"/update.sh echo "exit" >> "$SCRIPTS"/update.sh fi