Skip to content

Commit

Permalink
updt: common: schedule reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsubhranil committed Aug 19, 2022
1 parent 4874134 commit 2fee46a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
21 changes: 13 additions & 8 deletions common/etc/init.d/z_updater_post_update
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
9 changes: 2 additions & 7 deletions common/root/updater/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 2fee46a

Please sign in to comment.