vpn configuration menu style

This commit is contained in:
Bob Mottram 2018-04-04 13:18:45 +01:00
parent 054f5a1d16
commit 6fd1d1a5ed
1 changed files with 11 additions and 18 deletions

View File

@ -201,27 +201,20 @@ function configure_interactive_vpn {
read_config_param VPN_TLS_PORT
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone Control Panel" \
--title $"VPN Configuration" \
--radiolist $"Choose an operation:" 13 70 3 \
1 $"Change TLS port (currently $VPN_TLS_PORT)" off \
2 $"Regenerate keys for a user" off \
3 $"Exit" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
return;;
255) rm -f "$data"
return;;
esac
case $(cat "$data") in
W=(1 $"Change TLS port (currently $VPN_TLS_PORT)"
2 $"Regenerate keys for a user")
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"VPN" --menu $"Choose an operation, or ESC to exit:" 10 60 2 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
fi
case $selection in
1) vpn_change_tls_port;;
2) vpn_regenerate_client_keys;;
3) rm -f "$data"
break;;
esac
rm -f "$data"
done
}