From 1fbaa63834a649cf9c96aac9dca1bc566196d64b Mon Sep 17 00:00:00 2001 From: Lassulus Date: Sun, 9 Dec 2012 19:13:59 +0100 Subject: added variable stuff --- retiolum/scripts/tinc_setup/new_install.sh | 49 +++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 15 deletions(-) (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 dcbb2670..3afae31a 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -104,21 +104,40 @@ find_os() fi } -SUBNET4=10.243 -SUBNET6=42 -TEMPDIR=/tmp/tinc-install-fu -HOSTN=$(hostname) -NETNAME=retiolum -MASK4=16 -MASK6=16 -RAND4=1 -RAND6=1 -URL=euer.krebsco.de/retiolum/hosts.tar.gz -OS=0 - -IRCCHANNEL="#krebsco" -IRCSERVER="irc.freenode.net" -IRCPORT=6667 +SUBNET4=${SUBNET4:-10.243} +SUBNET6=${SUBNET6:-42} +TEMPDIR=${TEMPDIR:-/tmp/tinc-install-fu} +HOSTN=${HOSTN:-$(hostname)} +NETNAME=${NETNAME:-retiolum} +MASK4=${MASK4:-16} +MASK6=${MASK6:-16} +URL=${URL:-euer.krebsco.de/retiolum/hosts.tar.gz} + +IRCCHANNEL=${IRCCHANNEL:-"#krebsco"} +IRCSERVER=${IRCSERVER:-"irc.freenode.net"} +IRCPORT=${IRCPORT:-6667} + +OS=${OS:-0} + +IP4=${IP4:-0} +IP6=${IP6:-0} + +RAND4=0 +RAND6=0 + +if [ $IP4 -eq 0 ]; then + RAND4=1 +elif ! check_ip_valid4 $IP4; then + echo 'ip4 is invalid' + exit 1 +fi +if [ $IP6 -eq 0 ]; then + RAND6=1 +elif ! check_ip_valid6 $IP6; then + echo 'ip6 is invalid' + exit 1 +fi + #check if everything is installed if ! which tincd&>/dev/null; then -- cgit v1.2.3