diff options
author | krebs <krebs@steve> | 2011-11-08 10:37:02 -1100 |
---|---|---|
committer | krebs <krebs@steve> | 2011-11-08 10:37:02 -1100 |
commit | 58ec181dd1cd17997e35fb64ec2088fa4b2181dd (patch) | |
tree | d832bd0021f59fa2d9da6249ffb0aabe0300384c /retiolum/scripts/tinc_setup | |
parent | 8bbc9e204c5e493c9a0fb65b58d345eaaf725047 (diff) |
//retiolum install.sh: default hostname + eloop@ipv4
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rwxr-xr-x | retiolum/scripts/tinc_setup/install.sh | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh index a550a068..2198589b 100755 --- a/retiolum/scripts/tinc_setup/install.sh +++ b/retiolum/scripts/tinc_setup/install.sh @@ -22,11 +22,15 @@ echo "added known hosts:" ls -1 hosts | LC_ALL=C sort echo "delete the nodes you do not trust!" +hostname="${HOSTNAME-`cat /etc/hostname`}" myname="${1:-}" if [ ! "$myname" ] then - echo "select username: " + printf "select node name [$hostname]: " read myname + if test -z "$myname"; then + myname="$hostname" + fi fi if [ ! -e "hosts/$myname" ] then @@ -35,11 +39,13 @@ then if [ ! "$myipv4" ] then - echo "select v4 subnet ip (1-255) :" + printf 'select v4 subnet ip (1-255): ' read v4num - if ! $MYBIN/check-free-retiolum-v4 $v4num;then - exit 1 - fi + until $MYBIN/check-free-retiolum-v4 $v4num; do + echo "your're an idiot!" + printf 'select unused v4 subnet ip (1-255): ' + read v4num + done myipv4="10.7.7.$v4num" fi echo "Subnet = $myipv4" > hosts/$myname |