From b3006f309275ffb295bb3e13ea817e70283c6a60 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 28 Apr 2015 11:17:08 +0000 Subject: setup-hostname: fix name clash with openrc HOSTNAME openrc will set HOSTNAME to "(none)" which makes setup-hostname script go nuts. --- setup-hostname.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'setup-hostname.in') 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]: " -- cgit v1.2.3