aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-12-22 00:53:22 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-12-22 00:53:22 +0000
commitfb011f3f3d8986a95b03023848631389ae0169cb (patch)
tree2c7d8da698b4ffb08131de9142fc09abb3b9b0b6
parentbfecb33b0409e9f2d51483dbef5ee2c475c05278 (diff)
downloadpfsense-packages-fb011f3f3d8986a95b03023848631389ae0169cb.tar.gz
pfsense-packages-fb011f3f3d8986a95b03023848631389ae0169cb.tar.bz2
pfsense-packages-fb011f3f3d8986a95b03023848631389ae0169cb.zip
Stunnel setup commands.
-rw-r--r--packages/stunnel.xml15
1 files changed, 10 insertions, 5 deletions
diff --git a/packages/stunnel.xml b/packages/stunnel.xml
index 611f614c..aa348bd3 100644
--- a/packages/stunnel.xml
+++ b/packages/stunnel.xml
@@ -70,13 +70,18 @@
</fields>
<custom_php_install_command>
system("mkdir /var/tmp/stunnel 2>/dev/null");
+ system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem");
+ system("chmod a-r /usr/local/etc/stunnel/stunnel.pem");
+ system("chmod u+r /usr/local/etc/stunnel/stunnel.pem");
+ system("mkdir -p /var/tmp/stunnel/var/tmp");
+ system("chmod a+rw /var/tmp/stunnel/var/tmp/.");
</custom_php_install_command>
<custom_php_deinstall_command>
system("rm -rf /var/tmp/stunnel 2>/dev/null");
+ system("rm -rf /usr/local/etc/stunnel/stunnel.pem");
</custom_php_deinstall_command>
- <custom_add_php_command>
- global $config;
- $fout = fopen("/usr/local/etc/stunnel.conf","w");
+ <custom_add_php_command_late>
+ $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w");
fwrite($fout, "cert = /usr/local/etc/stunnel/mail.pem \n");
fwrite($fout, "chroot = /var/tmp/stunnel \n");
fwrite($fout, "setuid = stunnel \n");
@@ -84,10 +89,10 @@
foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) {
fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n");
fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n");
- fwrite($fout, "accept = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n\n");
+ fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n\n");
}
fclose($fout);
system("/usr/bin/killall stunnel 2>/dev/null");
system("/usr/local/sbin/stunnel 2>/dev/null");
- </custom_add_php_command>
+ </custom_add_php_command_late>
</packagegui>