diff options
author | wes <wes@FreeBSD.org> | 2006-01-18 04:48:45 +0000 |
---|---|---|
committer | wes <wes@FreeBSD.org> | 2006-01-18 04:48:45 +0000 |
commit | 1ba68b0ac579a801e78b1591ad48bf336ec69597 (patch) | |
tree | 67dbf7110b636a761fd5798446db9aadac9cb620 /sbin | |
parent | b04b9d3ae483ab97279b0374e46638e73ee8a1e0 (diff) | |
download | FreeBSD-src-1ba68b0ac579a801e78b1591ad48bf336ec69597.zip FreeBSD-src-1ba68b0ac579a801e78b1591ad48bf336ec69597.tar.gz |
Revert previous change, "getopts" (with an 's') is a builtin in
/bin/sh.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/reboot/nextboot.sh | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/sbin/reboot/nextboot.sh b/sbin/reboot/nextboot.sh index ece2da9..56e53f6 100644 --- a/sbin/reboot/nextboot.sh +++ b/sbin/reboot/nextboot.sh @@ -8,46 +8,31 @@ delete="NO" force="NO" nextboot_file="/boot/nextboot.conf" -kernel="" display_usage() { echo "Usage: nextboot [-f] [-o options] -k kernel" echo " nextboot -D" } -# Parse args, do not use getopt because we don't want to rely on /usr -while test $# -gt 0; do - case $1 in - -D) +while getopts "Dfk:o:" argument ; do + case "${argument}" in + D) delete="YES" ;; - -f) + f) force="YES" ;; - -k) - if test $# -lt 2; then - echo "$0: option $1 must specify kernel" - display_usage - exit 1 - fi - kernel="$2" - shift + k) + kernel="${OPTARG}" ;; - -o) - if test $# -lt 2; then - echo "$0: option $1 must specify boot options" - display_usage - exit 1 - fi - kernel_options="$2" - shift + o) + kernel_options="${OPTARG}" ;; *) display_usage exit 1 ;; esac - shift done if [ ${delete} = "YES" ]; then |