aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEirik Oeverby <ltning@anduin.net>2009-03-08 21:34:50 +0100
committerBill Marquette <bill.marquette@gmail.com>2009-03-08 16:06:22 -0500
commitdff5764a0cfce21dd1e48ed0cdf016efe78aa061 (patch)
tree9407361f703c5619e9aebc731dd1532e2ded5f0e
parent5ee52d94c6ffa509d4cca370a707553434ee4685 (diff)
downloadpfsense-packages-dff5764a0cfce21dd1e48ed0cdf016efe78aa061.tar.gz
pfsense-packages-dff5764a0cfce21dd1e48ed0cdf016efe78aa061.tar.bz2
pfsense-packages-dff5764a0cfce21dd1e48ed0cdf016efe78aa061.zip
Create necessary directories, add 'local =' parameter
Ensures stunnel can actually be used after installation. Add optional 'local =' parameter to a tunnel, to force binding to a particular IP for outgoing connections. Useful for transport mode IPSec, or with VPNs in general. Known issues: After (re)install, list of tunnels must be saved once to produce proper config file. Not sure why this isn't happening automagically. Signed-off-by: Bill Marquette <bill.marquette@gmail.com> Minor tweaks to original patch added as part of this commit
-rw-r--r--config/stunnel.xml14
1 files changed, 7 insertions, 7 deletions
diff --git a/config/stunnel.xml b/config/stunnel.xml
index d2f0dd3a..ef526309 100644
--- a/config/stunnel.xml
+++ b/config/stunnel.xml
@@ -149,16 +149,16 @@
</custom_add_php_command_late>
<custom_php_install_command>
<![CDATA[
- safe_mkdir("/usr/local/etc/stunnel");
- system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null");
- chmod("/usr/local/etc/stunnel/stunnel.pem", 600);
- system("/bin/mkdir -p /var/tmp/stunnel/var/tmp/run/stunnel");
- system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel");
+ safe_mkdir("/usr/local/etc/stunnel");
+ system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null");
+ chmod("/usr/local/etc/stunnel/stunnel.pem", 600);
+ make_dirs("/var/tmp/stunnel/var/tmp/run/stunnel");
+ system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel");
$_rcfile['file']='stunnel.sh';
$_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t";
$_rcfile['stop'].="killall stunnel \n\t";
write_rcfile($_rcfile);
- system("rm /usr/local/etc/rc.d/stunnel");
+ unlink_if_exists("/usr/local/etc/rc.d/stunnel");
conf_mount_rw();
config_lock();
@@ -183,7 +183,7 @@
<![CDATA[
rmdir_recursive("/var/tmp/stunnel");
rmdir_recursive("/usr/local/etc/stunnel*");
- system("rm /usr/local/etc/rc.d/stunnel.sh");
+ unlink_if_exists("/usr/local/etc/rc.d/stunnel.sh");
]]>
</custom_php_deinstall_command>
</packagegui>