aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/sbin
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-07-17 09:27:14 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-07-17 09:27:14 +0000
commit68e0aebc344f8c0fff66e0f885e092fc57e7b634 (patch)
treef3678011bd099c6553a8721e601284877df2c194 /package/base-files/files/sbin
parent4e7f4a35b5ec7e59eae8ec3ad1fd4fdaa80af8bf (diff)
downloadmaster-187ad058-68e0aebc344f8c0fff66e0f885e092fc57e7b634.tar.gz
master-187ad058-68e0aebc344f8c0fff66e0f885e092fc57e7b634.tar.bz2
master-187ad058-68e0aebc344f8c0fff66e0f885e092fc57e7b634.zip
[package] base-files: add -h and --help options to sysupgrade (#9728)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27630 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/sbin')
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 3d76bb3a0e..7efb2b4365 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -10,6 +10,7 @@ export SAVE_CONFIG=1
export SAVE_OVERLAY=0
export DELAY=
export CONF_IMAGE=
+export HELP=0
# parse options
while [ -n "$1" ]; do
@@ -21,6 +22,7 @@ while [ -n "$1" ]; do
-n) export SAVE_CONFIG=0;;
-c) export SAVE_OVERLAY=1;;
-f) export CONF_IMAGE="$2"; shift;;
+ -h|--help) export HELP=1; break;;
-*)
echo "Invalid option: $1"
exit 1
@@ -36,7 +38,7 @@ export CONF_TAR=/tmp/sysupgrade.tgz
export ARGV="$*"
export ARGC="$#"
-[ -z "$ARGV" ] && {
+[ -z "$ARGV" -o $HELP -gt 0 ] && {
cat <<EOF
Usage: $0 [options] <image file or URL>
@@ -48,6 +50,7 @@ Options:
-n do not save configuration over reflash
-q less verbose
-v more verbose
+ -h / --help display this help
EOF
exit 1