From bfd977f5731617287e5bb3f9b17b9b0417265623 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 10 Aug 2022 18:19:46 +0100 Subject: [PATCH 1/3] Update install.sh --- install.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index d2bb2bc..c372506 100644 --- a/install.sh +++ b/install.sh @@ -4,6 +4,26 @@ uname=$(whoami) admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16) +# Choice for DNS or IP +PS3='Choose your preferred option, IP or DNS/Domain: ' +WAN=("IP" "DNS/Domain") +select WANOPT in "${WAN[@]}"; do + case $WANOPT in + "IP") + wanip=$(dig @resolver4.opendns.com myip.opendns.com +short) + echo $wanip + break + ;; + + "DNS/Domain") + echo -ne "Enter your preferred domain/dns address ${NC}: " + read wanip + echo $wanip + break + ;; + *) echo "invalid option $REPLY";; + esac +done # Setup prereqs for server if [[ $(which yum) ]]; then @@ -94,9 +114,6 @@ while ! [[ $CHECK_RUSTDESK_READY ]]; do sleep 3 done -#Get WAN IP -wanip=$(dig @resolver4.opendns.com myip.opendns.com +short) - pubname=$(find /opt/rustdesk -name *.pub) key=$(cat "${pubname}") From 8b65e3b46caf75cf9869a5c0ecd8eed581b59aca Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 10 Aug 2022 18:23:39 +0100 Subject: [PATCH 2/3] Update install.sh --- install.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index c372506..622d1e0 100644 --- a/install.sh +++ b/install.sh @@ -5,24 +5,24 @@ uname=$(whoami) admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16) # Choice for DNS or IP -PS3='Choose your preferred option, IP or DNS/Domain: ' +PS3='Choose your preferred option, IP or DNS/Domain:' WAN=("IP" "DNS/Domain") select WANOPT in "${WAN[@]}"; do - case $WANOPT in - "IP") - wanip=$(dig @resolver4.opendns.com myip.opendns.com +short) - echo $wanip - break - ;; +case $WANOPT in +"IP") +wanip=$(dig @resolver4.opendns.com myip.opendns.com +short) +echo $wanip +break +;; - "DNS/Domain") - echo -ne "Enter your preferred domain/dns address ${NC}: " - read wanip - echo $wanip - break - ;; - *) echo "invalid option $REPLY";; - esac +"DNS/Domain") +echo -ne "Enter your preferred domain/dns address ${NC}: " +read wanip +echo $wanip +break +;; +*) echo "invalid option $REPLY";; +esac done # Setup prereqs for server From 6fcebde1281ab54c342100c2a76d4c6f43616097 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Wed, 10 Aug 2022 18:29:07 +0100 Subject: [PATCH 3/3] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 622d1e0..a10064e 100644 --- a/install.sh +++ b/install.sh @@ -182,7 +182,7 @@ sudo systemctl enable gohttpserver.service sudo systemctl start gohttpserver.service -echo -e "Your IP is ${wanip}" +echo -e "Your IP/DNS Address is ${wanip}" echo -e "Your public key is ${key}" echo -e "Install Rustdesk on your machines and change your public key and IP/DNS name to the above" echo -e "You can access your install scripts for clients by going to http://${wanip}:8000"