upgrade 973 B

12345678910111213141516171819202122232425262728293031323334353637
  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 &> /dev/null
  18. bash ./install "${domain}" "${path}" "${wifi_ssid}" "${wifi_passphrase}" "${firmware_nonfree}"
  19. # Changes
  20. if [ "$(ynh_setting hotspot ip6_firewall)" == '' ]; then
  21. multissid=$(ynh_setting hotspot multissid)
  22. ip6_firewall=$(printf '1|%.0s' $(seq "${multissid}"))
  23. ip6_firewall=$(echo "${ip6_firewall%?}")
  24. sudo yunohost app setting hotspot ip6_firewall -v "${ip6_firewall}"
  25. fi
  26. sudo systemctl start ynh-hotspot
  27. exit 0