diff options
Diffstat (limited to 'config/openvpn-client-export/openvpn-client-export.inc')
-rwxr-xr-x | config/openvpn-client-export/openvpn-client-export.inc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index 16ccb6a4..9488119e 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -44,17 +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"; - $phpfile = "vpn_openvpn_export.php"; - $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() { |