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 18:54:59 +02:00

24 lines
634 B
Bash

#!/bin/bash
yunohost_setting() {
sudo grep "^${1}:" "/etc/yunohost/apps/hotspot/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
}
domain=$(yunohost_setting domain)
path=$(yunohost_setting path)
wifi_ssid=$(yunohost_setting wifi_ssid)
wifi_passphrase=$(yunohost_setting 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