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

convert multissid settings

This commit is contained in:
HgO 2023-08-20 18:02:20 +02:00
parent 64075f2dd9
commit 5b4c94c042
2 changed files with 24 additions and 2 deletions

View file

@ -132,7 +132,6 @@ fi
hot_reload_usb_wifi_cards
wifi_device=$(iw_devices | awk -F\| '{ print $1 }')
ynh_app_setting_set --app=$app --key=ssid_nb --value=1
ynh_app_setting_set --app=$app --key=wifi_ssid --value="${wifi_ssid}"
ynh_app_setting_set --app=$app --key=wifi_secure --value=1
ynh_app_setting_set --app=$app --key=wifi_passphrase --value="${wifi_passphrase}"

View file

@ -72,7 +72,26 @@ if [ -z $service_name ]; then
ynh_app_setting_set --app=$app --key=service_name --value=$service_name
fi
dns=$(ynh_app_setting_get $app dns)
multissid=$(ynh_app_setting_get --app=$app --key=multissid)
if [[ -n ${multissid} ]] && [[ ${multissid} -gt 1 ]]; then
wifi_ssid=$(ynh_app_setting_get --app=$app --key=wifi_ssid | cut -d'|' -f 1)
wifi_secure=$(ynh_app_setting_get --app=$app --key=wifi_secure | cut -d'|' -f 1)
wifi_passphrase=$(ynh_app_setting_get --app=$app --key=wifi_passphrase | cut -d'|' -f 1)
ip4_nat_prefix=$(ynh_app_setting_get --app=$app --key=ip4_nat_prefix | cut -d'|' -f 1)
ip6_net=$(ynh_app_setting_get --app=$app --key=ip6_net | cut -d'|' -f 1)
ip6_firewall=$(ynh_app_setting_get --app=$app --key=ip6_firewall | cut -d'|' -f 1)
dns=$(ynh_app_setting_get --app=$app --key=dns | cut -d'|' -f 1)
ynh_app_setting_set --app=$app --key=wifi_ssid --value="${wifi_ssid}"
ynh_app_setting_set --app=$app --key=wifi_secure --value="${wifi_secure}"
ynh_app_setting_set --app=$app --key=wifi_passphrase --value="${wifi_passphrase}"
ynh_app_setting_set --app=$app --key=ip4_nat_prefix --value="${ip4_nat_prefix}"
ynh_app_setting_set --app=$app --key=ip6_net --value="${ip6_net}"
ynh_app_setting_set --app=$app --key=ip6_firewall --value="${ip6_firewall}"
else
dns=$(ynh_app_setting_get --app=$app --key=dns)
fi
if [[ -n "${dns}" ]]; then
ip6_dns=""
ip4_dns=""
@ -97,6 +116,10 @@ if [[ -n "${dns}" ]]; then
ynh_app_setting_delete $app dns
fi
if [[ -n ${multissid} ]]; then
ynh_app_setting_delete --app=$app --key=multissid
fi
# Old stuff prior to 2.x
ip6_net=$(ynh_app_setting_get --app=$app --key=ip6_net)