summaryrefslogtreecommitdiff
path: root/scripts
Side-by-side diff
Diffstat (limited to 'scripts') (more/less context) (show whitespace changes)
-rw-r--r--scripts/update/opie-update.control4
-rwxr-xr-xscripts/update/opie-update.postinst52
2 files changed, 56 insertions, 0 deletions
diff --git a/scripts/update/opie-update.control b/scripts/update/opie-update.control
new file mode 100644
index 0000000..e00debc
--- a/dev/null
+++ b/scripts/update/opie-update.control
@@ -0,0 +1,4 @@
+Maintainer: Patrick S. Vogt <tille@handhelds.org>
+Description: Reinstall opie
+Dummy package that reinstalls opie, by removing
+everything and reinstalling it.
diff --git a/scripts/update/opie-update.postinst b/scripts/update/opie-update.postinst
new file mode 100755
index 0000000..70a5008
--- a/dev/null
+++ b/scripts/update/opie-update.postinst
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# script to remove and reinstall opie
+#
+# it's free so do not sell it
+# (c) patrick s. vogtp <tille@handhelds.org>
+
+IPKG_REMOVE="ipkg remove"
+IPKG_INSTALL="ipkg install"
+echo "Upating opie"
+pack=`ipkg status | grep Package | grep -i opie | sed "s/Package://"`
+
+
+echo "Stopping Opie"
+`/etc/init.d/qpe stop`
+
+
+for p in $pack; do
+cmd="$IPKG_REMOVE $p"
+echo "$cmd"
+$cmd
+done
+
+#to be sure
+pack2=`ipkg status | grep Package | grep -i opie | sed "s/Package://"`
+while [ $pack2 != "" ]
+do
+for p in $pack2; do
+cmd="$IPKG_REMOVE $p"
+echo "$cmd"
+$cmd
+done
+pack2=`ipkg status | grep Package | grep -i opie | sed "s/Package://"`
+done;
+
+#might help
+sync
+
+
+echo "Updateing"
+`ipkg update`
+
+for p in $pack; do
+cmd="$IPKG_INSTALL $p"
+echo "$cmd"
+$cmd
+done
+
+ipkg remove opie-update
+
+echo "Starting Opie"
+`/etc/init.d/qpe start`