7 script_path="/usr/pandora/scripts/op_osupgrade_work.sh"
8 script_pkg="pandora-scripts"
9 script_updated_f="/tmp/upgrade_script_updated"
11 echo "Updating package lists..."
14 echo "Checking for updated packages..."; \
16 # check if this script was updated. If it was, update and restart it
17 if opkg list-upgradable | grep -q "$script_pkg"; then
18 mtime_pre=`stat -c '%Y' $script_path`
19 opkg install $script_pkg
20 mtime_post=`stat -c '%Y' $script_path`
21 if [ "$mtime_pre" != "$mtime_post" -a ! -e "$script_updated_f" ]; then
23 touch "$script_updated_f"
24 echo "Update script was updated, restarting.."
29 # check if opkg was updated.. Maybe we can fix it's breakages someday..
30 for o in `opkg list-upgradable | grep opkg | awk '{print $1}'`; do
35 if [ "$opkg_updated" = "1" ]; then
39 # finally run the upgrade itself
43 xinitrc="/home/$SUDO_USER/.xinitrc"
44 if test -e "$xinitrc" && ! cmp -s /etc/skel/.xinitrc "$xinitrc"; then
45 # ... only from a known old version
46 known="5642b24d5d4570c6779807904506c162 b2cf2d45ef7f3bee9836105008c009a7"
47 md5=`md5sum "$xinitrc" | awk '{print $1}'`
49 if [ "$md5" = "$k" ]; then
50 cp -av /etc/skel/.xinitrc "$xinitrc"
60 # do we still need this?
61 echo "Finished, press Ctrl-C to exit"