diff --git a/install.sh b/install.sh index d2bb2bc..a10064e 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}") @@ -165,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"