summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/tinc_setup
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2013-01-06 03:04:47 +0000
committermakefu <root@pigstarter.de>2013-01-06 03:04:47 +0000
commit7f97a33b1a8c427f29eab3a015df6581bb6bab36 (patch)
tree412419bb6f7f826a6c0f7e1e35dd14222da55537 /retiolum/scripts/tinc_setup
parent414f96a2431e1a61412c2c5b4533fbcbb53499f6 (diff)
fix new_install installer
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rwxr-xr-xretiolum/scripts/tinc_setup/new_install.sh9
1 files changed, 8 insertions, 1 deletions
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}