1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00

ip6_net/addr -> change 'none' to empty string for better config panel integration / optional management etc (none ain't a valid IPv6 address)

This commit is contained in:
Alexandre Aubin 2021-10-17 22:09:02 +02:00
parent 43b5c68d30
commit 4031ed4567
3 changed files with 17 additions and 3 deletions

View file

@ -27,7 +27,7 @@ has_vpnclient_app() {
has_ip6delegatedprefix() { has_ip6delegatedprefix() {
i=${1} i=${1}
[ "${ynh_ip6_net[${i}]}" != none ] [[ -n "${ynh_ip6_net[${i}]}" ]] && [[ "${ynh_ip6_net[${i}]}" != "none" ]]
} }
is_nat_set() { is_nat_set() {

View file

@ -118,8 +118,8 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Configuring hotspot..." ynh_script_progression --message="Configuring hotspot..."
if [[ ! -v ip6_net ]]; then # if ip6_net not set if [[ ! -v ip6_net ]]; then # if ip6_net not set
ip6_net=none ip6_net=""
ip6_addr=none ip6_addr=""
if [[ -e /tmp/.ynh-vpnclient-started ]]; then if [[ -e /tmp/.ynh-vpnclient-started ]]; then
vpnclient_ip6_net=$(ynh_app_setting_get vpnclient ip6_net 2>&1) vpnclient_ip6_net=$(ynh_app_setting_get vpnclient ip6_net 2>&1)

View file

@ -73,6 +73,20 @@ fi
# Old stuff prior to 2.x # Old stuff prior to 2.x
ip6_net=$(ynh_app_setting_get --app=$app --key=ip6_net)
if [ "$ip6_net" == "none" ]
then
ip6_net=""
ynh_app_setting_set --app=$app --key=ip6_net --value="$ip6_net"
fi
ip6_addr=$(ynh_app_setting_get --app=$app --key=ip6_addr)
if [ "$ip6_addr" == "none" ]
then
ip6_addr=""
ynh_app_setting_set --app=$app --key=ip6_addr --value="$ip6_addr"
fi
if [ -f /etc/nginx/conf.d/*.d/$app.conf ]; then if [ -f /etc/nginx/conf.d/*.d/$app.conf ]; then
ynh_secure_remove /etc/nginx/conf.d/*.d/$app.conf ynh_secure_remove /etc/nginx/conf.d/*.d/$app.conf
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload