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
2015-07-24 19:09:56 +02:00

27 lines
673 B
Bash

#!/bin/bash
ynh_setting() {
app=${1}
setting=${2}
sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
}
domain=$(ynh_setting hotspot domain)
path=$(ynh_setting hotspot path)
wifi_ssid=$(ynh_setting hotspot wifi_ssid)
wifi_passphrase=$(ynh_setting hotspot wifi_passphrase)
if dpkg -l firmware-linux-nonfree &> /dev/null; then
firmware_nonfree=yes
else
firmware_nonfree=no
fi
export HOTSPOT_UPGRADE=1
sudo bash /etc/yunohost/apps/hotspot/scripts/remove
bash ./install "${domain}" "${path}" "${wifi_ssid}" "${wifi_passphrase}" "${firmware_nonfree}"
sudo systemctl start ynh-hotspot
exit 0