1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00
hotspot_ynh/scripts/upgrade

25 lines
634 B
Text
Raw Normal View History

2015-07-13 15:59:05 +02:00
#!/bin/bash
2015-07-24 18:43:19 +02:00
yunohost_setting() {
2015-07-24 18:52:25 +02:00
sudo grep "^${1}:" "/etc/yunohost/apps/hotspot/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
2015-07-24 18:43:19 +02:00
}
2015-07-13 15:59:05 +02:00
2015-07-24 18:43:19 +02:00
domain=$(yunohost_setting domain)
path=$(yunohost_setting path)
wifi_ssid=$(yunohost_setting wifi_ssid)
wifi_passphrase=$(yunohost_setting wifi_passphrase)
2015-07-13 15:59:05 +02:00
if dpkg -l firmware-linux-nonfree &> /dev/null; then
2015-07-24 18:43:19 +02:00
firmware_nonfree=yes
2015-07-13 15:59:05 +02:00
else
2015-07-24 18:43:19 +02:00
firmware_nonfree=no
2015-07-13 15:59:05 +02:00
fi
2015-07-24 18:43:19 +02:00
export HOTSPOT_UPGRADE=1
2015-07-24 18:54:59 +02:00
sudo bash /etc/yunohost/apps/hotspot/scripts/remove
2015-07-24 18:52:25 +02:00
bash ./install "${domain}" "${path}" "${wifi_ssid}" "${wifi_passphrase}" "${firmware_nonfree}"
2015-07-13 15:59:05 +02:00
2015-07-24 18:43:19 +02:00
sudo systemctl start ynh-hotspot
2015-07-13 15:59:05 +02:00
exit 0