docs/ikteam: Delete most files.
[haiku.git] / 3rdparty / mmu_man / scripts / myupdate.sh
blobd4057e106ef8905d86935aba94d92aed2f571ed4
1 #!/bin/sh
3 cd "$(dirname "$0")"
5 test "$1" = "-t" || exec Terminal -t "My Update" "$0" -t "$@" && shift
7 notice () {
8 notify --type information \
9 --icon /boot/system/apps/HaikuDepot \
10 --title "Update" \
11 "$@"
12 echo "$@"
15 if [ "$1" != "-2" ]; then
17 notice "Closing Deskbar..."
18 notice "Checking for updates..."
19 quit application/x-vnd.Be-TSKB
20 sync
21 hrev_current="$(uname -v | cut -d' ' -f1)"
22 pkgman update
23 pkgman_err=$?
24 sync
25 if [ $pkgman_err -gt 0 -o "$(ls /system/packages/*_hrev*-* | grep -v $hrev_current)" = "" ]; then
26 open /system/Deskbar < /dev/null > /dev/null 2>&1 &
27 notice "Restarting Deskbar..."
28 #notice "Nothing to do"
29 read -p "Press a key..."
30 exit $pkgman_err
32 makebootable /boot
33 sync
34 notice "Restarting Deskbar..."
35 /system/Deskbar < /dev/null > /dev/null 2>&1 &
36 notice "You should reboot now..."
37 shutdown -r -a
38 sleep 5
39 #read
40 exit 0
43 rm $(finddir B_USER_SETTINGS_DIRECTORY)/boot/launch/myupdate2.sh