mirror of
https://github.com/techahold/rustdeskinstall.git
synced 2024-07-02 10:36:15 +02:00
Update install.sh
This commit is contained in:
parent
fc9a935121
commit
4977bd764c
50
install.sh
50
install.sh
|
@ -4,30 +4,6 @@
|
||||||
uname=$(whoami)
|
uname=$(whoami)
|
||||||
admintoken=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16)
|
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)
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
|
|
||||||
"DNS/Domain")
|
|
||||||
echo -ne "Enter your preferred domain/dns address ${NC}: "
|
|
||||||
read wanip
|
|
||||||
#check wanip is valid domain
|
|
||||||
if ! [[ $wanip =~ ^[a-zA-Z0-9]+([a-zA-Z0-9.-]*[a-zA-Z0-9]+)?$ ]]; then
|
|
||||||
echo -e "${RED}Invalid domain/dns address${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*) echo "invalid option $REPLY";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# identify OS
|
# identify OS
|
||||||
if [ -f /etc/os-release ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
# freedesktop.org and systemd
|
# freedesktop.org and systemd
|
||||||
|
@ -102,6 +78,32 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
|
||||||
|
"DNS/Domain")
|
||||||
|
echo -ne "Enter your preferred domain/dns address ${NC}: "
|
||||||
|
read wanip
|
||||||
|
#check wanip is valid domain
|
||||||
|
if ! [[ $wanip =~ ^[a-zA-Z0-9]+([a-zA-Z0-9.-]*[a-zA-Z0-9]+)?$ ]]; then
|
||||||
|
echo -e "${RED}Invalid domain/dns address${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*) echo "invalid option $REPLY";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# #/*
|
# #/*
|
||||||
# Alternatively since case is faster than if then else
|
# Alternatively since case is faster than if then else
|
||||||
# case ${IDLIKE} in
|
# case ${IDLIKE} in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user