diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-04-28 11:17:08 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-04-28 11:17:08 +0000 |
commit | b3006f309275ffb295bb3e13ea817e70283c6a60 (patch) | |
tree | 75cb221a8915d92c3f225ae7d9611485212fd0a9 /setup-hostname.in | |
parent | 3f769dc941363dc1d4b4d3c898e6236003fddee8 (diff) | |
download | alpine-conf-b3006f309275ffb295bb3e13ea817e70283c6a60.zip |
setup-hostname: fix name clash with openrc HOSTNAME
openrc will set HOSTNAME to "(none)" which makes setup-hostname script
go nuts.
Diffstat (limited to 'setup-hostname.in')
-rw-r--r-- | setup-hostname.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/setup-hostname.in b/setup-hostname.in index c699d54..16d9b6b 100644 --- a/setup-hostname.in +++ b/setup-hostname.in @@ -42,17 +42,17 @@ valid_hostname() { while getopts "hn:" opt; do case $opt in h) usage;; - n) HOSTNAME="$OPTARG";; + n) name="$OPTARG";; esac done shift $(( $OPTIND - 1 )) -if [ -z "$HOSTNAME" ] && [ $# -eq 1 ]; then - HOSTNAME="$1" +if [ -z "$name" ] && [ $# -eq 1 ]; then + name="$1" fi while true; do - if [ -n "$HOSTNAME" ]; then - HOST="$HOSTNAME" + if [ -n "$name" ]; then + HOST="$name" else HOST=`hostname` echon "Enter system hostname (short form, e.g. 'foo') [$HOST]: " |