From 2e44499238125dbecbbf17222496ebba315cc90c Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 4 Feb 2010 22:14:47 +0100 Subject: rename update to adkupdate --- package/base-files/extra/sbin/adkupdate | 75 +++++++++++++++++++++++++++++++++ package/base-files/extra/sbin/update | 75 --------------------------------- 2 files changed, 75 insertions(+), 75 deletions(-) create mode 100755 package/base-files/extra/sbin/adkupdate delete mode 100755 package/base-files/extra/sbin/update (limited to 'package/base-files') diff --git a/package/base-files/extra/sbin/adkupdate b/package/base-files/extra/sbin/adkupdate new file mode 100755 index 000000000..d41e23a0f --- /dev/null +++ b/package/base-files/extra/sbin/adkupdate @@ -0,0 +1,75 @@ +#!/bin/sh + +who=$(id -u) +if [ $who -ne 0 ]; then + echo 'Exit. System update must be run as root.' + exit 1 +fi + +if [ -x /sbin/mtd ];then + updatecmd="mtd -r write - linux" +else + updatecmd="gunzip -c | tar -xf -" +fi + +check_exit() { + if [ $? -ne 0 ];then + echo "Update failed." + exit 1 + fi +} + +prepare() { + cd / + umount -f /etc + mount -o remount,rw / +} + +extract_from_file() { + prepare + cat $1 | eval $updatecmd + check_exit +} + +extract_from_ssh() { + prepare + ssh $1 "cat $2" | eval $updatecmd + check_exit +} + +extract_from_http() { + prepare + wget -O - $1 | eval $updatecmd + check_exit +} + +case $1 in + file://*|/*) + url=$(echo $1|sed -e "s#file://##") + echo "Updating system from $1" + extract_from_file $url + ;; + ssh://*) + host=$(echo $1|sed -e "s#ssh://\(.*\):.*#\1#") + file=$(echo $1|sed -e "s#ssh://.*:\(.*\)#\1#") + echo "Updating system from $1" + extract_from_ssh $host $file + ;; + http://*|ftp://*) + echo "Updating system from $1" + extract_from_http $1 + ;; + *) + echo "No or wrong uri given. exit." + echo "Use one of the following uri:" + echo "http://myserver/myupdate.tar.gz" + echo "ssh://myuser@myserver:/my/path/myupdate.tar.gz" + echo "file:///mypath/myupdate.tar.gz" + exit 1 + ;; +esac + +sync +mount -o bind /etc /tmp/.cfgfs/root + +echo "Update sucessful. You should reboot now." diff --git a/package/base-files/extra/sbin/update b/package/base-files/extra/sbin/update deleted file mode 100755 index d41e23a0f..000000000 --- a/package/base-files/extra/sbin/update +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -who=$(id -u) -if [ $who -ne 0 ]; then - echo 'Exit. System update must be run as root.' - exit 1 -fi - -if [ -x /sbin/mtd ];then - updatecmd="mtd -r write - linux" -else - updatecmd="gunzip -c | tar -xf -" -fi - -check_exit() { - if [ $? -ne 0 ];then - echo "Update failed." - exit 1 - fi -} - -prepare() { - cd / - umount -f /etc - mount -o remount,rw / -} - -extract_from_file() { - prepare - cat $1 | eval $updatecmd - check_exit -} - -extract_from_ssh() { - prepare - ssh $1 "cat $2" | eval $updatecmd - check_exit -} - -extract_from_http() { - prepare - wget -O - $1 | eval $updatecmd - check_exit -} - -case $1 in - file://*|/*) - url=$(echo $1|sed -e "s#file://##") - echo "Updating system from $1" - extract_from_file $url - ;; - ssh://*) - host=$(echo $1|sed -e "s#ssh://\(.*\):.*#\1#") - file=$(echo $1|sed -e "s#ssh://.*:\(.*\)#\1#") - echo "Updating system from $1" - extract_from_ssh $host $file - ;; - http://*|ftp://*) - echo "Updating system from $1" - extract_from_http $1 - ;; - *) - echo "No or wrong uri given. exit." - echo "Use one of the following uri:" - echo "http://myserver/myupdate.tar.gz" - echo "ssh://myuser@myserver:/my/path/myupdate.tar.gz" - echo "file:///mypath/myupdate.tar.gz" - exit 1 - ;; -esac - -sync -mount -o bind /etc /tmp/.cfgfs/root - -echo "Update sucessful. You should reboot now." -- cgit v1.2.3