Commit 22c565db authored by Franco Fichtner's avatar Franco Fichtner

openvpn: go full-circle on zip package

We don't need 7z anymore, so it's better to use the lightweight package.

(cherry picked from commit 804d915b)
parent 8e294e37
......@@ -94,7 +94,6 @@ CORE_DEPENDS?= apinger \
openvpn \
opnsense-lang \
opnsense-update \
p7zip \
pecl-radius \
pftop \
phalcon \
......@@ -133,7 +132,8 @@ CORE_DEPENDS?= apinger \
suricata \
syslogd \
unbound \
wol
wol \
zip
WRKDIR?=${.CURDIR}/work
WRKSRC?=${WRKDIR}/src
......
......@@ -370,7 +370,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys
}
}
$command = "cd " . escapeshellarg("{$tempdir}/..")
. " && /usr/local/bin/7z -tzip -y a "
. " && /usr/local/bin/zip -r "
. escapeshellarg("/tmp/{$prefix}-config.zip")
. " " . escapeshellarg($prefix);
exec($command);
......@@ -563,7 +563,7 @@ EOF;
exec("cd {$tempdir}/.. && /usr/bin/tar cfz {$outputfile} Viscosity.visc");
} else {
$outputfile = "/tmp/{$uniq}-Viscosity.visc.zip";
exec("cd {$tempdir}/.. && /usr/local/bin/7z -tzip -y a {$outputfile} Viscosity.visc");
exec("cd {$tempdir}/.. && /usr/local/bin/zip -r {$outputfile} Viscosity.visc");
}
// Remove temporary directory
......@@ -688,7 +688,7 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
file_put_contents("{$tempdir}/{$prefix}.ovpn", $conf);
$shkeyfile = "{$tempdir}/{$shkeyfile}";
file_put_contents("{$shkeyfile}", base64_decode($settings['shared_key']));
exec("cd {$tempdir}/.. && /usr/local/bin/7z -tzip -y a /tmp/{$prefix}-config.zip {$prefix}");
exec("cd {$tempdir}/.. && /usr/local/bin/zip -r /tmp/{$prefix}-config.zip {$prefix}");
// Remove temporary directory
exec("rm -rf {$tempdir}");
return "/tmp/{$prefix}-config.zip";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment