Ask for domain first and only complain if vpn files are not available
This commit is contained in:
parent
980dcf01df
commit
59c8de0089
|
@ -157,20 +157,10 @@ function mesh_setup_vpn {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function connect_to_vpn {
|
function connect_to_mesh {
|
||||||
dialog --title $"VPN Connect to another mesh network" \
|
|
||||||
--backtitle $"Freedombone Mesh" \
|
|
||||||
--defaultno \
|
|
||||||
--yesno $"\nHave you received the vpn.tar.gz file from the other mesh administrator, uncompressed it into the /home/fbone directory and also forwarded port $VPN_MESH_TLS_PORT from your internet router to this system?" 10 70
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
1) return;;
|
|
||||||
255) return;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
data=$(tempfile 2>/dev/null)
|
data=$(tempfile 2>/dev/null)
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
trap "rm -f $data" 0 1 2 5 15
|
||||||
dialog --title $"VPN Connect to another mesh network" \
|
dialog --title $"Connect to another mesh network" \
|
||||||
--backtitle $"Freedombone Mesh" \
|
--backtitle $"Freedombone Mesh" \
|
||||||
--inputbox $'Enter the IP address or domain name of the other mesh.' 10 60 2>$data
|
--inputbox $'Enter the IP address or domain name of the other mesh.' 10 60 2>$data
|
||||||
sel=$?
|
sel=$?
|
||||||
|
@ -180,15 +170,20 @@ function connect_to_vpn {
|
||||||
if [ ${#ip_or_domain} -gt 1 ]; then
|
if [ ${#ip_or_domain} -gt 1 ]; then
|
||||||
if [[ "$ip_or_domain" == *'.'* ]]; then
|
if [[ "$ip_or_domain" == *'.'* ]]; then
|
||||||
|
|
||||||
|
connect_failed=
|
||||||
if [ ! -f ~/client.ovpn ]; then
|
if [ ! -f ~/client.ovpn ]; then
|
||||||
rm $data
|
connect_failed=1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
if [ ! -f ~/stunnel.pem ]; then
|
if [ ! -f ~/stunnel.pem ]; then
|
||||||
rm $data
|
connect_failed=1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
if [ ! -f ~/stunnel.p12 ]; then
|
if [ ! -f ~/stunnel.p12 ]; then
|
||||||
|
connect_failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $connect_failed ]; then
|
||||||
|
dialog --title $"Connect to another mesh network" \
|
||||||
|
--msgbox $"\nObtain the vpn.tar.gz file from the other mesh administrator, uncompress it into the /home/fbone directory and also forwarded port $VPN_MESH_TLS_PORT from your internet router to this system." 10 50
|
||||||
rm $data
|
rm $data
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -221,7 +216,7 @@ case $sel in
|
||||||
esac
|
esac
|
||||||
case $(cat $data) in
|
case $(cat $data) in
|
||||||
1) rm $data
|
1) rm $data
|
||||||
connect_to_vpn;;
|
connect_to_mesh;;
|
||||||
2) rm $data
|
2) rm $data
|
||||||
mesh_setup_vpn;;
|
mesh_setup_vpn;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue