summaryrefslogtreecommitdiff
path: root/package/base-files/extra/sbin/update
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-12-04 21:37:31 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2009-12-04 21:37:31 +0100
commit9230fde0381a7dcc7e3d86e954382a01a8fcfd63 (patch)
tree9d91f16d2871df6b1bb1c398b7cbe5478b546918 /package/base-files/extra/sbin/update
parent9bacd09cc5280924908fc4bba494856bbe37c47f (diff)
parentb047da059a1042a27ba68b1bdc50dd187bd362f4 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/base-files/extra/sbin/update')
-rwxr-xr-xpackage/base-files/extra/sbin/update12
1 files changed, 9 insertions, 3 deletions
diff --git a/package/base-files/extra/sbin/update b/package/base-files/extra/sbin/update
index 10d6e58c2..0cd4ee713 100755
--- a/package/base-files/extra/sbin/update
+++ b/package/base-files/extra/sbin/update
@@ -6,9 +6,6 @@ if [ $who -ne 0 ]; then
exit 1
fi
-cd /
-umount -f /etc
-mount -o remount,rw /
check_exit() {
if [ $? -ne 0 ];then
@@ -17,17 +14,26 @@ check_exit() {
fi
}
+prepare() {
+ cd /
+ umount -f /etc
+ mount -o remount,rw /
+}
+
extract_from_file() {
+ prepare
cat $1 | gunzip -c | tar -xf -
check_exit
}
extract_from_ssh() {
+ prepare
ssh $1 "cat $2" | gunzip -c | tar -xf -
check_exit
}
extract_from_http() {
+ prepare
wget -O - $1 | gunzip -c | tar -xf -
check_exit
}