aboutsummaryrefslogtreecommitdiffstats
path: root/packages/frickin/frickin.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-11-30 18:51:21 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-11-30 18:51:21 +0000
commitf33a58171fced03272598e5ff94a9c18a9fa5222 (patch)
tree1a29d0d69c7aaccb21c555e6a85b90ae54acd707 /packages/frickin/frickin.inc
parent04e5496a7c8e2ac3a523d04d02155f203608af6b (diff)
downloadpfsense-packages-f33a58171fced03272598e5ff94a9c18a9fa5222.tar.gz
pfsense-packages-f33a58171fced03272598e5ff94a9c18a9fa5222.tar.bz2
pfsense-packages-f33a58171fced03272598e5ff94a9c18a9fa5222.zip
Update frickin PPTP Proxy package
Diffstat (limited to 'packages/frickin/frickin.inc')
-rw-r--r--packages/frickin/frickin.inc51
1 files changed, 51 insertions, 0 deletions
diff --git a/packages/frickin/frickin.inc b/packages/frickin/frickin.inc
new file mode 100644
index 00000000..9a5d9f05
--- /dev/null
+++ b/packages/frickin/frickin.inc
@@ -0,0 +1,51 @@
+<?php
+
+function frickin_custom_php_install_command() {
+ $fout = fopen("/usr/local/etc/rc.d/frickin.sh", "w");
+ fwrite($fout, "#!/bin/sh\n# This package was automatically generated\n# by the pfSense package system.\n\n");
+ fwrite($fout, "# PACKAGE: Frickin Proxy\n");
+ fwrite($fout, "# EXECUTABLE: frickin\n");
+ fwrite($fout, "/usr/local/bin/frickin");
+ fwrite($fout, " -s 127.0.0.1");
+ fwrite($fout, " -c 20");
+ fwrite($fout, " &amp;\n");
+ fclose($fout);
+ mwexec("/usr/bin/killall frickin");
+ mwexec("chmod a+rx /usr/local/etc/rc.d/frickin.sh");
+ mwexec("/usr/local/etc/rc.d/frickin.sh");
+}
+
+function custom_php_deinstall_command() {
+ unlink_if_exists("/usr/local/etc/rc.d/frickin.sh");
+ unlink_if_exists("/usr/local/bin/frickin");
+}
+
+function frickin_generate_rules($type) {
+ global $config;
+
+ $frickin_conf = $config['installedpackages']['frickin']['config'][0];
+ if (!is_service_running('frickin')) {
+ log_error("Frickin is installed but not started. Not installing redirect rules.");
+ return;
+ }
+
+ $ifaces = explode(',', $frickin_conf['active_interface']);
+ $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
+
+ switch($type) {
+ case 'nat':
+ foreach ($ifaces as $iface) {
+ $rules .= "rdr on $iface proto tcp from any to !($iface) port 1723 -> 127.0.0.1\n";
+ $rules .= "rdr on $iface proto gre from any to !($iface) -> 127.0.0.1\n";
+ }
+ break;
+ case 'filter':
+ break;
+ default:
+ break;
+ }
+
+ return $rules;
+}
+
+?> \ No newline at end of file