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
|