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

56 lines
1.5 KiB
Text
Raw Normal View History

2015-07-13 15:59:05 +02:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2015-07-24 19:09:56 +02:00
source _common.sh
source /usr/share/yunohost/helpers
2015-07-13 15:59:05 +02:00
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
2015-07-13 15:59:05 +02:00
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path)
wifi_ssid=$(ynh_app_setting_get $app wifi_ssid)
wifi_passphrase=$(ynh_app_setting_get $app wifi_passphrase)
firmware_nonfree=$(ynh_app_setting_get $app firmware_nonfree)
final_path=$(ynh_app_setting_get $app final_path)
multissid=$(ynh_app_setting_get $app multissid)
2015-07-13 15:59:05 +02:00
#=================================================
# CHECK THE PATH
#=================================================
2015-07-26 10:43:44 +02:00
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
2015-07-13 15:59:05 +02:00
#=================================================
# SPECIFIC UPGRADE
#=================================================
source ./prerequisites
2015-07-26 10:43:44 +02:00
2015-07-24 23:48:24 +02:00
# Changes
if [[ -z $(ynh_app_setting_get $app ip6_firewall) ]]; then
2015-07-24 23:48:24 +02:00
ip6_firewall=$(printf '1|%.0s' $(seq "${multissid}"))
ip6_firewall=$(echo "${ip6_firewall%?}")
2019-02-09 11:24:32 +01:00
ynh_app_setting_set "${app}" ip6_firewall "${ip6_firewall}"
2015-07-24 23:48:24 +02:00
fi
ynh_systemctl start ynh-hotspot