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
2018-05-10 14:15:18 +02:00

55 lines
1.6 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# 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)
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# SPECIFIC UPGRADE
#=================================================
source ./prerequisites
# Changes
if [[ -z $(ynh_app_setting_get $app ip6_firewall) ]]; then
ip6_firewall=$(printf '1|%.0s' $(seq "${multissid}"))
ip6_firewall=$(echo "${ip6_firewall%?}")
ynh_app_setting_set "${app}" ip6_firewall -v "${ip6_firewall}"
fi
ynh_systemctl start ynh-hotspot