Commit ace05c78 authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-hostname: remove -n option

but accept it for compat reasons
parent de933a2c
......@@ -7,13 +7,14 @@ PREFIX=
usage() {
cat <<__EOF__
usage: setup-hostname [-h] [-n hostname]
usage: setup-hostname [-h] [HOSTNAME]
Sets the system hostname.
options:
-h Show this help
-n Specify the hostname to set
Sets hostname to HOSTNAME or prompt if unspecified.
__EOF__
exit 1
}
......@@ -44,7 +45,10 @@ while getopts "hn:" opt; do
n) HOSTNAME="$OPTARG";;
esac
done
shift $(( $OPTIND - 1 ))
if [ -z "$HOSTNAME" ] && [ $# -eq 1 ]; then
HOSTNAME="$1"
fi
while true; do
if [ -n "$HOSTNAME" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment