Merge branch 'CleanupTunnels' into release-3.15.1.0

various fixups to improve the quality of bringing tunnel's into mainline code
This commit is contained in:
Conrad Lara - KG6JEI 2015-05-24 15:18:54 -07:00
commit af1eaa1107
5 changed files with 50 additions and 35 deletions

View File

@ -106,8 +106,9 @@ apply_uci_config() {
}
start() {
# only if vtun is installed
if [[ -x "/usr/sbin/vtund" ]]
# only if vtun is installed and ind mesh mode
configmode=$(uci -q -c /etc/local/uci/ get hsmmmesh.settings.config)
if [ -x "/usr/sbin/vtund" -a "$configmode" = "mesh" ]
then
apply_uci_config
config_load vtun

12
files/etc/init.d/vtundsrv Normal file → Executable file
View File

@ -97,6 +97,11 @@ apply_uci_config() {
}
start() {
configmode=$(uci -q -c /etc/local/uci/ get hsmmmesh.settings.config)
if [ -x "/usr/sbin/vtund" -a "$configmode" = "mesh" ]
then
apply_uci_config
config_load vtun
@ -120,13 +125,20 @@ start() {
# START SERVER LISTENER
/usr/sbin/vtund -s -f $SERVER_CONF
fi
}
stop() {
# only if vtun is installed
if [ -x "/usr/sbin/vtund" ]
then
# find the vtund SERVER process... --- FIX THIS
for x in `ps -w|grep -F 'vtund[s]:'|grep -v grep|awk '{print $1}'`
do
s=`echo $s $x`
done
kill $s
fi
}

View File

@ -215,10 +215,6 @@ sub install_vtun
# allow port 5525 for server connections
open_5525_on_wan();
# enable init.d scripts
system("chmod +x /etc/init.d/vtundsrv");
system("chmod +x /etc/init.d/vtund");
# create UCI config file
system("touch /etc/config/vtun");
# create options section

View File

@ -197,8 +197,8 @@ if($parms{button_save} and not @cli_err)
if (&uci_commit("vtun"))
{
push(@errors,"Problem committing UCI vtun");
system("cp -f /etc/config/vtun /etc/config.mesh");
}
system("cp -f /etc/config/vtun /etc/config.mesh");
unless($debug == 3)
{
# Regenerate olsrd files and restart olsrd
@ -214,6 +214,9 @@ if($parms{button_save} and not @cli_err)
http_header() unless $debug == 2;
html_header("$node setup", 1);
print "<body><center>\n";
alert_banner();
print "<form id=vpn method=post action=/cgi-bin/vpn enctype='multipart/form-data'>\n" unless $debug == 2;
print "<form method=post action=test>\n" if $debug == 2;
print "<table width=790>\n";

View File

@ -175,8 +175,8 @@ if($parms{button_save} and not @conn_err)
if (&uci_commit("vtun"))
{
push(@errors,"Problem committing UCI vtun");
system("cp -f /etc/config/vtun /etc/config.mesh");
}
system("cp -f /etc/config/vtun /etc/config.mesh");
unless($debug == 3)
{
# Regenerate olsrd files and restart olsrd
@ -193,6 +193,9 @@ http_header() unless $debug == 2;
html_header("$node setup", 1);
print "<body><center>\n";
alert_banner();
print "<form method=post action=/cgi-bin/vpnc enctype='multipart/form-data'>\n" unless $debug == 2;
print "<form method=post action=test>\n" if $debug == 2;
print "<table width=790>\n";