From 7f97a33b1a8c427f29eab3a015df6581bb6bab36 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 6 Jan 2013 03:04:47 +0000 Subject: fix new_install installer --- retiolum/scripts/tinc_setup/new_install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'retiolum/scripts/tinc_setup/new_install.sh') diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 1d16cfb9..410dce62 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -12,7 +12,14 @@ SUBNET4=${SUBNET4:-10.243} SUBNET6=${SUBNET6:-42} TEMPDIR=${TEMPDIR:-auto} TINCDIR=${TINCDIR:-auto} -SYSHOSTN=${HOSTNAME:-$(hostname)} + +if type hostname >/dev/null ;then SYSHOSTN=${HOSTNAME:-$(hostname)} +elif type uci >/dev/null ;then SYSHOSTN=$(uci get system.@system[0].hostname) +elif [ -e /etc/hostname ] ;then SYSHOSTN=$(cat /etc/hostname) +else SYSHOSTN="unknown" +fi + +#overwrite `found` hostname HOSTN=${HOSTN:-$SYSHOSTN} NETNAME=${NETNAME:-retiolum} MASK4=${MASK4:-16} -- cgit v1.2.3