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 23:48:24 +02:00
|
|
|
# Changes
|
|
|
|
|
|
|
|
if [ "$(ynh_setting hotspot ip6_firewall)" == '' ]; then
|
|
|
|
multissid=$(ynh_setting hotspot multissid)
|
|
|
|
ip6_firewall=$(printf '1|%.0s' $(seq "${multissid}"))
|
|
|
|
ip6_firewall=$(echo "${ip6_firewall%?}")
|
|
|
|
|
|
|
|
sudo yunohost app setting hotspot ip6_firewall -v "${ip6_firewall}"
|
|
|
|
fi
|
|
|
|
|
2015-07-24 18:43:19 +02:00
|
|
|
sudo systemctl start ynh-hotspot
|
2015-07-13 15:59:05 +02:00
|
|
|
|
|
|
|
exit 0
|