fix client options and disconnect graphic

This commit is contained in:
Darryl Quinn 2015-04-26 23:21:42 -05:00
parent 7327c2de51
commit 5d6ba0c244
3 changed files with 15 additions and 3 deletions

View File

@ -112,6 +112,16 @@ start() {
apply_uci_config
config_load vtun
#if options section doesn't exist, add it
echo "testing for options..."
j=`uci get vtun.@options[0]`
if [ $? -ne 0 ]
then
j=`uci add vtun options`
j='uci commit vtun'
config_load vtun
fi
# Remove the current vtun config file
rm -f $CLIENT_CONF

View File

@ -442,7 +442,6 @@ sub save_clients()
$rc=&uci_set_indexed_option("vtun","client",$i,"serverip",$serverip);
push(@cli_err,"Problem saving UCI vtun client server IP (#$i)") if $rc;
$rc=&uci_set_indexed_option("vtun","client",$i,"node",$vtun_node_name);
push(@cli_err,"Problem saving UCI vtun client name (#$i)") if $rc;

View File

@ -335,8 +335,11 @@ sub print_vpn_connections()
print "</td>";
print "<td>&nbsp;";
print "<img class='tun_client_active_img' src='/plug-connect.png'/>" if (&is_tunnel_active($netip,@active_tun) && ($val ne "_add"));
print "<img class='tun_client_inactive_img' src='/plug-disconnect.png'/>" if ($val ne "_add");
if (&is_tunnel_active($netip,@active_tun) && ($val ne "_add")) {
print "<img class='tun_client_active_img' src='/plug-connect.png'/>";
} else {
print "<img class='tun_client_inactive_img' src='/plug-disconnect.png'/>" if ($val ne "_add");
}
print "</td>";
print "<td>&nbsp;";