upgrade 753 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. ynh_setting() {
  3. app=${1}
  4. setting=${2}
  5. sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
  6. }
  7. domain=$(ynh_setting torclient domain)
  8. path=$(ynh_setting torclient path)
  9. tmpdir=$(mktemp -dp /tmp/ torclient-upgrade-XXXXX)
  10. sudo cp -a /etc/yunohost/apps/torclient/settings.yml "${tmpdir}/"
  11. export TORCLIENT_UPGRADE=1
  12. sudo bash /etc/yunohost/apps/torclient/scripts/remove &> /dev/null
  13. bash ./install "${domain}" "${path}"
  14. gitcommit=$(ynh_setting torclient gitcommit)
  15. sudo cp -a "${tmpdir}/settings.yml" /etc/yunohost/apps/torclient/
  16. sudo rm -r "${tmpdir}/"
  17. sudo yunohost app setting torclient gitcommit -v "${gitcommit}"
  18. sudo systemctl start ynh-torclient
  19. exit 0