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

28 lines
673 B
Text
Raw Normal View History

2015-07-13 15:59:05 +02:00
#!/bin/bash
2015-07-24 19:09:56 +02:00
ynh_setting() {
app=${1}
setting=${2}
sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/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 19:09:56 +02:00
domain=$(ynh_setting hotspot domain)
path=$(ynh_setting hotspot path)
wifi_ssid=$(ynh_setting hotspot wifi_ssid)
wifi_passphrase=$(ynh_setting hotspot 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