2015-07-13 15:59:05 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2015-07-24 19:09:56 +02:00
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
2015-07-13 15:59:05 +02:00
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
2015-07-13 15:59:05 +02:00
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
2015-09-29 18:01:10 +02:00
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
#=================================================
|
|
|
|
# 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
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK THE PATH
|
|
|
|
#=================================================
|
2015-07-26 10:43:44 +02:00
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
# Normalize the URL path syntax
|
|
|
|
path_url=$(ynh_normalize_url_path $path_url)
|
2015-07-13 15:59:05 +02:00
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC UPGRADE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source ./prerequisites
|
2015-07-26 10:43:44 +02:00
|
|
|
|
2015-07-24 23:48:24 +02:00
|
|
|
# Changes
|
|
|
|
|
2018-05-04 00:33:01 +02:00
|
|
|
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
|
|
|
|
|
2019-02-18 01:07:31 +01:00
|
|
|
# Make sure that the yunohost service has a description and need-lock enabled
|
|
|
|
yunohost service remove ynh-hotspot
|
|
|
|
yunohost service add ynh-hotspot --description "creates a Wi-Fi access point" --need_lock
|
2019-02-17 22:25:04 +01:00
|
|
|
yunohost service start ynh-hotspot
|