Merge pull request #3 from dinger1986/dev-1

Dev 1
This commit is contained in:
dinger1986 2022-08-10 18:29:32 +01:00 committed by GitHub
commit 1303936d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"