From 28a545a6f2ba1004da4467708df0a65641a29a3b Mon Sep 17 00:00:00 2001 From: Julien VAUBOURG Date: Fri, 24 Jul 2015 19:09:56 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 660bd17..476ad3d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,13 +1,16 @@ #!/bin/bash -yunohost_setting() { - sudo grep "^${1}:" "/etc/yunohost/apps/hotspot/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$// +ynh_setting() { + app=${1} + setting=${2} + + sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/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) +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