No need to sudo all over the place

This commit is contained in:
Alexandre Aubin
2018-12-03 01:04:24 +01:00
committed by pitchum
parent fe159638f5
commit ed60b7782a
6 changed files with 79 additions and 79 deletions

View File

@@ -26,12 +26,12 @@ sysuser="vpnclient" # XXX hard-coded variable
backup_dir="${1}/apps/vpnclient"
sudo mkdir -p /etc/openvpn/
sudo cp -a "${backup_dir}/keys/" /etc/openvpn/
sudo cp -a "${backup_dir}/client.conf.tpl" /etc/openvpn/
sudo chown -R root:${sysuser} /etc/openvpn/keys/
mkdir -p /etc/openvpn/
cp -a "${backup_dir}/keys/" /etc/openvpn/
cp -a "${backup_dir}/client.conf.tpl" /etc/openvpn/
chown -R root:${sysuser} /etc/openvpn/keys/
gitcommit=$(sudo grep revision /etc/yunohost/apps/vpnclient/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/')
gitcommit=$(grep revision /etc/yunohost/apps/vpnclient/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/')
tmpdir=$(mktemp -dp /tmp/ vpnclient-restore-XXXXX)
git clone https://github.com/labriqueinternet/vpnclient_ynh.git "${tmpdir}/"
@@ -40,4 +40,4 @@ git --work-tree "${tmpdir}/" --git-dir "${tmpdir}/.git/" reset --hard "${gitcomm
cd "${tmpdir}/scripts/"
bash ./upgrade
sudo rm -r "${tmpdir}/"
rm -r "${tmpdir}/"