Skip to content

Commit

Permalink
fixed bug of not rebooting after upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
herry13 committed Apr 16, 2018
1 parent 4405eac commit 9c4456f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fruit-update.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ flag_dir=/media/mmcblk0p1
flag_file="$flag_dir/$(echo "$non_active" | sed 's/\//./g').dirty"

apk_log_file=/var/log/fruit-update-apk.log
echo "started $(date)" >> $apk_log_file
[ -f $apk_log_file ] && mv -f $apk_log_file $apk_log_file.old
echo "started $(date)" > $apk_log_file

logger -st fruit "Updating $non_active"

Expand Down Expand Up @@ -125,8 +126,8 @@ mark_dirty $non_active && \
mark_clean $non_active
ret=$?
if [ $ret -eq 0 ]; then
totalupgraded=$(grep ") Upgrading " /tmp/.fruit-update.apk-upgrade.stdout 2>/dev/null | wc -l)
totalinstalled=$(grep ") Installing " /tmp/.fruit-update.apk-upgrade.stdout 2>/dev/null | wc -l)
totalupgraded=$(grep ") Upgrading " $apk_log_file 2>/dev/null | wc -l)
totalinstalled=$(grep ") Installing " $apk_log_file 2>/dev/null | wc -l)
[ $totalupgraded -gt 0 ] && touch /run/fruit-update.reboot
[ $totalinstalled -gt 0 ] && touch /run/fruit-update.reboot
logger -st fruit "Updated $non_active ($totalupgraded packages upgraded, $totalinstalled packages installed)"
Expand Down

0 comments on commit 9c4456f

Please sign in to comment.