2013-12-29 14:49:58 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
test "$1" = "-t" || exec Terminal -t "My Update" "$0" -t "$@" && shift
|
|
|
|
|
|
|
|
notice () {
|
|
|
|
notify --type information \
|
|
|
|
--icon /boot/system/apps/HaikuDepot \
|
|
|
|
--title "Update" \
|
|
|
|
"$@"
|
|
|
|
echo "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" != "-2" ]; then
|
2014-01-09 20:04:23 +04:00
|
|
|
|
|
|
|
notice "Closing Deskbar..."
|
2013-12-29 14:49:58 +04:00
|
|
|
notice "Checking for updates..."
|
2014-01-09 20:04:23 +04:00
|
|
|
quit application/x-vnd.Be-TSKB
|
2013-12-29 14:49:58 +04:00
|
|
|
sync
|
2014-08-04 02:21:58 +04:00
|
|
|
hrev_current="$(uname -v | cut -d' ' -f1)"
|
|
|
|
pkgman update
|
|
|
|
pkgman_err=$?
|
|
|
|
sync
|
|
|
|
if [ $pkgman_err -gt 0 -o "$(ls /system/packages/*_hrev*-* | grep -v $hrev_current)" = "" ]; then
|
2014-01-09 20:04:23 +04:00
|
|
|
open /system/Deskbar < /dev/null > /dev/null 2>&1 &
|
|
|
|
notice "Restarting Deskbar..."
|
2014-08-04 02:21:58 +04:00
|
|
|
#notice "Nothing to do"
|
|
|
|
read -p "Press a key..."
|
|
|
|
exit $pkgman_err
|
2013-12-29 14:49:58 +04:00
|
|
|
fi
|
|
|
|
makebootable /boot
|
2014-01-09 20:04:23 +04:00
|
|
|
sync
|
|
|
|
notice "Restarting Deskbar..."
|
|
|
|
/system/Deskbar < /dev/null > /dev/null 2>&1 &
|
2013-12-29 14:49:58 +04:00
|
|
|
notice "You should reboot now..."
|
|
|
|
shutdown -r -a
|
2014-08-04 02:21:58 +04:00
|
|
|
sleep 5
|
|
|
|
#read
|
2013-12-29 14:49:58 +04:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm $(finddir B_USER_SETTINGS_DIRECTORY)/boot/launch/myupdate2.sh
|
|
|
|
|