summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/tinc_setup/new_install.sh
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-01-07 09:17:14 +0700
committermakefu <github@syntax-fehler.de>2013-01-07 09:17:14 +0700
commitd907a7aa781caac2a3086535f5ce997131170ca2 (patch)
tree3738bf31cd567dada4665bc46010de3e26fdc24e /retiolum/scripts/tinc_setup/new_install.sh
parent9a5edaac48e2461aa247204fbcea37d805bf38f0 (diff)
parent29d8a4e5061d66d0dfeda28a9012992c12a83ccd (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/scripts/tinc_setup/new_install.sh')
-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}