]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix lxc-shutdown argument parsing
authorDwight Engen <dwight.engen@oracle.com>
Wed, 9 Jan 2013 19:09:33 +0000 (14:09 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 9 Jan 2013 20:12:29 +0000 (15:12 -0500)
processing of -w or -r shifts an argument that isn't there, messing up
other argument processing

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc-shutdown.in

index edf735e54647dc0252a39b95f8d067c541657624..a033b1075b5185aa3794eee6cb6225a0e960c703 100644 (file)
@@ -62,6 +62,7 @@ while [ $# -gt 0 ]; do
     case "$opt" in
     -h|--help)
         usage
+        exit 0
         ;;
     -n|--name)
         optarg_check $opt "$1"
@@ -70,11 +71,9 @@ while [ $# -gt 0 ]; do
         ;;
     -w|--wait)
         dowait=1
-        shift
         ;;
     -r|--reboot)
         reboot=1
-        shift
         ;;
     -t|--timeout)
         optarg_check $opt "$1"
@@ -94,6 +93,7 @@ while [ $# -gt 0 ]; do
     *)
         usage_err "unknown option '$opt'"
         exit 1
+        ;;
     esac
 done