upgrade 673 B

123456789101112131415161718192021222324252627
  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 hotspot domain)
  8. path=$(ynh_setting hotspot path)
  9. wifi_ssid=$(ynh_setting hotspot wifi_ssid)
  10. wifi_passphrase=$(ynh_setting hotspot wifi_passphrase)
  11. if dpkg -l firmware-linux-nonfree &> /dev/null; then
  12. firmware_nonfree=yes
  13. else
  14. firmware_nonfree=no
  15. fi
  16. export HOTSPOT_UPGRADE=1
  17. sudo bash /etc/yunohost/apps/hotspot/scripts/remove
  18. bash ./install "${domain}" "${path}" "${wifi_ssid}" "${wifi_passphrase}" "${firmware_nonfree}"
  19. sudo systemctl start ynh-hotspot
  20. exit 0