prevent bad irc hostnames

dev
Tom Early 5 years ago
parent 42b5bb6cc2
commit 13b97a9397

@ -264,10 +264,24 @@ IrcddbMenu () {
EndMenu EndMenu
if [[ "$key" == l* ]]; then ircddb_login="${value^^}" if [[ "$key" == l* ]]; then ircddb_login="${value^^}"
elif [[ "$key" == ha* ]]; then ircddb0_host="$value" elif [[ "$key" == ha* ]]; then
if [[ "$value" =~ ^[a-zA-Z0-9]+\.[a-zA-Z0-9]+\.[a-zA-Z0-9]+$ ]]; then
ircddb0_host="$value"
else
clear
echo "$value is not a valid hostname"
read -p "<Enter> to continue: " garbage
fi
elif [[ "$key" == oa* ]]; then ircddb0_port="$value" elif [[ "$key" == oa* ]]; then ircddb0_port="$value"
elif [[ "$key" == aa* ]]; then ircddb0_password="$value" elif [[ "$key" == aa* ]]; then ircddb0_password="$value"
elif [[ "$key" == hb* ]]; then ircddb1_host="$value" elif [[ "$key" == hb* ]]; then
if [[ "$value" =~ ^[a-zA-Z0-9]+\.[a-zA-Z0-9]+\.[a-zA-Z0-9]+$ ]]; then
ircddb1_host="$value"
else
clear
echo "$value is not a valid hostname"
read -p "<Enter> to continue: " garbage
fi
elif [[ "$key" == ob* ]]; then ircddb1_port="$value" elif [[ "$key" == ob* ]]; then ircddb1_port="$value"
elif [[ "$key" == ab* ]]; then ircddb1_password="$value" elif [[ "$key" == ab* ]]; then ircddb1_password="$value"
elif [[ "$key" == u* ]]; then elif [[ "$key" == u* ]]; then
@ -702,7 +716,7 @@ while [[ "$ans" != q* ]]
do do
clear clear
echo echo
echo " QnConfig Main Menu V#210201" echo " QnConfig Main Menu V#210207"
echo echo
echo -n "a : Module A - "; if [ -z $module_a ]; then echo "<EMPTY>"; else echo "${module_a^^}"; fi echo -n "a : Module A - "; if [ -z $module_a ]; then echo "<EMPTY>"; else echo "${module_a^^}"; fi
echo -n "b : Module B - "; if [ -z $module_b ]; then echo "<EMPTY>"; else echo "${module_b^^}"; fi echo -n "b : Module B - "; if [ -z $module_b ]; then echo "<EMPTY>"; else echo "${module_b^^}"; fi

Loading…
Cancel
Save

Powered by TurnKey Linux.