From 58ec181dd1cd17997e35fb64ec2088fa4b2181dd Mon Sep 17 00:00:00 2001 From: krebs Date: Tue, 8 Nov 2011 10:37:02 -1100 Subject: //retiolum install.sh: default hostname + eloop@ipv4 --- retiolum/scripts/tinc_setup/install.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'retiolum/scripts/tinc_setup/install.sh') 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 -- cgit v1.2.3