Last active
August 2, 2022 03:37
-
-
Save mxyq/b58f957a6f45303c6f916cf4b26dec51 to your computer and use it in GitHub Desktop.
[Read from type] #Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read -n1 -r -p "Press any key to continue..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo | |
echo "Which protocol should OpenVPN use?" | |
echo " 1) UDP (recommended)" | |
echo " 2) TCP" | |
read -p "Protocol [1]: " protocol | |
until [[ -z "$protocol" || "$protocol" =~ ^[12]$ ]]; do | |
echo "$protocol: invalid selection." | |
read -p "Protocol [1]: " protocol | |
done | |
case "$protocol" in | |
1|"") | |
protocol=udp | |
;; | |
2) | |
protocol=tcp | |
;; | |
esac | |
echo | |
echo "What port should OpenVPN listen to?" | |
read -p "Port [1194]: " port | |
until [[ -z "$port" || "$port" =~ ^[0-9]+$ && "$port" -le 65535 ]]; do | |
echo "$port: invalid port." | |
read -p "Port [1194]: " port | |
done | |
[[ -z "$port" ]] && port="1194" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment