aboutsummaryrefslogtreecommitdiffstats
path: root/packages/frickin
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
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')
-rw-r--r--packages/frickin/frickin.inc51
-rw-r--r--packages/frickin/frickin.xml28
2 files changed, 62 insertions, 17 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
diff --git a/packages/frickin/frickin.xml b/packages/frickin/frickin.xml
index f3974a55..b507649e 100644
--- a/packages/frickin/frickin.xml
+++ b/packages/frickin/frickin.xml
@@ -4,26 +4,20 @@
<version>1.2</version>
<configpath>installedpackages->package->$packagename->configuration->settings</configpath>
<additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>077</chmod>
+ <item>http://www.pfsense.com/packages/config/frickin/frickin.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
<prefix>/usr/local/bin/</prefix>
- <chmod>0755</chmod>
- <item>http://www.pfsense.com/packages/All/frickin</item>
- </additional_files_needed>
+ <chmod>077</chmod>
+ <item>http://www.pfsense.com/packages/config/frickin/bin/frickin</item>
+ </additional_files_needed>
<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");
+ frickin_custom_php_install_command();
</custom_php_install_command>
<custom_php_deinstall_command>
- unlink_if_exists("/usr/local/etc/rc.d/frickin.sh");
- unlink_if_exists("/usr/local/bin/frickin");
+ frickin_custom_php_deinstall_command();
</custom_php_deinstall_command>
+ <include_file>/usr/local/pkg/frickin.inc</include_file>
</packagegui>