Commit b3006f30 authored by Natanael Copa's avatar Natanael Copa

setup-hostname: fix name clash with openrc HOSTNAME

openrc will set HOSTNAME to "(none)" which makes setup-hostname script
go nuts.
parent 3f769dc9
......@@ -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]: "
......
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