aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-04-30 10:24:27 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-04-30 10:24:27 -0300
commitdfc34277832af026453dac3c88aa2f5102d5964b (patch)
tree904e60cb40597b730e2ed81f0c8bf3b9b13f4bdc /config
parentaa0f81ed5f0951ee3aed8992316443787f68e2bb (diff)
downloadpfsense-packages-dfc34277832af026453dac3c88aa2f5102d5964b.tar.gz
pfsense-packages-dfc34277832af026453dac3c88aa2f5102d5964b.tar.bz2
pfsense-packages-dfc34277832af026453dac3c88aa2f5102d5964b.zip
On 2.3+, openvpn-client-export tarball files will be already present on system, it's not necessary to uncompress tarball anymore
Diffstat (limited to 'config')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc20
1 files changed, 12 insertions, 8 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index 1e76c743..9488119e 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -44,16 +44,20 @@ $current_openvpn_version_rev = "03";
function openvpn_client_export_install() {
global $current_openvpn_version;
- conf_mount_rw();
- $tarpath = "/usr/local/pkg/openvpn-client-export-{$current_openvpn_version}.tgz";
- $ovpndir = "/usr/local/share/openvpn";
- $workdir = "{$ovpndir}/client-export";
- if (!is_dir($workdir))
- mkdir($workdir, 0777, true);
+ $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+ if ($pfs_version == "2.1" || $pfs_version == "2.2") {
+ conf_mount_rw();
+ $tarpath = "/usr/local/pkg/openvpn-client-export-{$current_openvpn_version}.tgz";
+ $ovpndir = "/usr/local/share/openvpn";
+ $workdir = "{$ovpndir}/client-export";
- exec("/usr/bin/tar zxf {$tarpath} -C {$ovpndir}");
- conf_mount_ro();
+ if (!is_dir($workdir))
+ mkdir($workdir, 0777, true);
+
+ exec("/usr/bin/tar zxf {$tarpath} -C {$ovpndir}");
+ conf_mount_ro();
+ }
}
function openvpn_client_export_deinstall() {