aboutsummaryrefslogtreecommitdiffstats
path: root/config/zebedee/zebedee_get_key.php
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2011-10-17 19:58:17 -0200
committermarcelloc <marcellocoutinho@gmail.com>2011-10-17 19:58:17 -0200
commite4145897ff096831668ab3d02a190ff1dc81dffe (patch)
treeb4b1fff78aba6e3a5ea94c9e71d496ff73a18f13 /config/zebedee/zebedee_get_key.php
parentf52026d30ffc5354a99999b5b036c67188b6018d (diff)
downloadpfsense-packages-e4145897ff096831668ab3d02a190ff1dc81dffe.tar.gz
pfsense-packages-e4145897ff096831668ab3d02a190ff1dc81dffe.tar.bz2
pfsense-packages-e4145897ff096831668ab3d02a190ff1dc81dffe.zip
zebedee tunneling package
Diffstat (limited to 'config/zebedee/zebedee_get_key.php')
-rw-r--r--config/zebedee/zebedee_get_key.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/config/zebedee/zebedee_get_key.php b/config/zebedee/zebedee_get_key.php
new file mode 100644
index 00000000..f0af0b8a
--- /dev/null
+++ b/config/zebedee/zebedee_get_key.php
@@ -0,0 +1,44 @@
+<?
+
+require_once("pkg-utils.inc");
+
+$id= $_REQUEST['id'] ;
+//echo "<pre>" ;
+$external = $config['installedpackages']['zebedee']['config'][0]['external_address'] ;
+$chave = $config['installedpackages']['zebedeekeys']["config"][$id] ;
+
+//print_r($chave['row']) ;
+
+
+
+foreach ($chave['row'] as $k => $v)
+{
+ // especify only one port for this host
+// if($v['port']=="") $end=" " ; else $end = ":".$v['port'] ;
+ $tunnels .= "tunnel ".$v['loc_port'].":".$v['ipaddress'].":".$v['rmt_port']."\r\n" ;
+}
+
+
+header('Content-Type: application/download');
+header('Content-Disposition: filename=client.txt');
+
+$chave_result = <<<EOF
+verbosity 2
+server false
+message {$chave["ident"]}
+detached true
+privatekey "{$chave["private_key"]}"
+ipmode both
+compression zlib:9
+
+serverhost {$external}
+
+{$tunnels}
+
+EOF;
+
+
+echo $chave_result ;
+
+
+?> \ No newline at end of file