restore 526 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # The parameter $1 is the uncompressed restore directory location
  3. backup_dir="${1}/apps/vpnclient"
  4. mkdir -p /etc/openvpn/
  5. cp -a "${backup_dir}/keys/" /etc/openvpn/
  6. gitcommit=$(sudo yunohost app setting vpnclient gitcommit)
  7. tmpdir=$(mktemp -dp /tmp/ vpnclient-restore-XXXXX)
  8. git clone https://github.com/labriqueinternet/vpnclient_ynh.git "${tmpdir}/"
  9. git --work-tree "${tmpdir}/" --git-dir "${tmpdir}/.git/" reset --hard "${gitcommit}"
  10. cd "${tmpdir}/scripts/"
  11. bash ./upgrade
  12. sudo rm -r "${tmpdir}/"
  13. exit 0