diff --git a/common/etc/init.d/z_updater_post_update b/common/etc/init.d/z_updater_post_update index 46cce2a..77cc128 100755 --- a/common/etc/init.d/z_updater_post_update +++ b/common/etc/init.d/z_updater_post_update @@ -13,14 +13,19 @@ start() { rm $HOOKSDIR/$FILE rm -f /rwm/upper$HOOKSDIR/$FILE rebootIfNeeded + if [ -e "$NEEDSREBOOT" ]; then + break + fi FILE=$(ls $HOOKSDIR | grep "post-update-stage*" | head -1) done - - log "Post-update hook execution finished!" - log "Disabling and removing post-update service.." - /etc/init.d/z_updater_post_update disable - rm -f /rwm/upper/etc/rc.d/S99z_updater_post_update - rm -f /rwm/upper/etc/init.d/z_updater_post_update - rm /etc/init.d/z_updater_post_update - log "Post-update service complete!" + + if [ ! -e "$NEEDSREBOOT" ]; then + log "Post-update hook execution finished!" + log "Disabling and removing post-update service.." + /etc/init.d/z_updater_post_update disable + rm -f /rwm/upper/etc/rc.d/S99z_updater_post_update + rm -f /rwm/upper/etc/init.d/z_updater_post_update + rm /etc/init.d/z_updater_post_update + log "Post-update service complete!" + fi } diff --git a/common/root/updater/common.sh b/common/root/updater/common.sh index 7844718..1034aa2 100755 --- a/common/root/updater/common.sh +++ b/common/root/updater/common.sh @@ -48,12 +48,7 @@ scheduleReboot() { rebootIfNeeded() { if [ -e "$NEEDSREBOOT" ]; then - log "Rebooting.." - while true - do - reboot - sleep 15 - log "Reboot failed! Retrying.." - done + log "Scheduling reboot after 10s.." + reboot -n 10 fi }