aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-01-13 16:35:40 -0500
committerjim-p <jimp@pfsense.org>2011-01-13 16:36:21 -0500
commit3595abb0f3b5f2dca21327bedeccdab4473e50e3 (patch)
tree3f62986a7510ac2cf691b20fa4642b141fcde49c /config/openvpn-client-export
parentda4d7a3c1e3296ebe92745187486d1b80cd9695d (diff)
downloadpfsense-packages-3595abb0f3b5f2dca21327bedeccdab4473e50e3.tar.gz
pfsense-packages-3595abb0f3b5f2dca21327bedeccdab4473e50e3.tar.bz2
pfsense-packages-3595abb0f3b5f2dca21327bedeccdab4473e50e3.zip
Check for missing template files and reinstall them if needed.
Diffstat (limited to 'config/openvpn-client-export')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index 144fe176..5cd75ce8 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -41,8 +41,8 @@ function openvpn_client_export_install() {
$ovpndir = "/usr/local/share/openvpn";
$workdir = "{$ovpndir}/client-export";
- if(!is_dir("/usr/local/share/openvpn"))
- mkdir("/usr/local/share/openvpn");
+ if (!is_dir($workdir))
+ mkdir($workdir, 0777, true);
exec("/usr/bin/tar zxf {$tarpath} -C {$ovpndir}");
conf_mount_ro();
@@ -53,6 +53,8 @@ function openvpn_client_export_deinstall() {
$phpfile = "vpn_openvpn_export.php";
$ovpndir = "/usr/local/share/openvpn";
$workdir = "{$ovpndir}/client-export";
+ if (!file_exists($workdir . "/template/openvpn-install.exe"))
+ openvpn_client_export_install();
unlink_if_exists("/usr/local/www/{$phpfile}");
exec("/bin/rm -r {$workdir}");
@@ -254,6 +256,8 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $uset
$ovpndir = "/usr/local/share/openvpn";
$workdir = "{$ovpndir}/client-export";
+ if (!file_exists($workdir . "/template/openvpn-install.exe"))
+ openvpn_client_export_install();
// lookup server settings
$settings = $config['openvpn']['openvpn-server'][$srvid];
@@ -377,6 +381,9 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead
global $config, $g;
$ovpndir = "/usr/local/share/openvpn/";
+ if (!file_exists($workdir . "/template/openvpn-install.exe"))
+ openvpn_client_export_install();
+
$uniq = uniqid();
$tempdir = $g['tmp_path'] . "/openvpn-export-" . $uniq;
$zipfile = $g['tmp_path'] . "/{$uniq}-Viscosity.visc.zip";