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

Merge branch 'testing' into remove_multissid

This commit is contained in:
Alexandre Aubin 2023-09-17 22:04:16 +02:00 committed by GitHub
commit 3be5d12a97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 16 deletions

View file

@ -117,19 +117,6 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
ynh_script_progression --message="Configuring hotspot..." ynh_script_progression --message="Configuring hotspot..."
ip6_net=""
ip6_dns=""
if [[ ! -v ip6_net ]]; then # if ip6_net not set
if [[ -e /tmp/.ynh-vpnclient-started ]]; then
vpnclient_ip6_net=$(ynh_app_setting_get vpnclient ip6_net 2>&1)
if [[ $vpnclient_ip6_net =~ :: ]]; then
ip6_net=${vpnclient_ip6_net}
ip6_dns="${ip6_net}1"
fi
fi
fi
ip4_nat_prefix_index=${app##*__} ip4_nat_prefix_index=${app##*__}
if [[ "${ip4_nat_prefix_index}" == "${app}" ]]; then if [[ "${ip4_nat_prefix_index}" == "${app}" ]]; then
ip4_nat_prefix_index=0 ip4_nat_prefix_index=0
@ -149,8 +136,6 @@ ynh_app_setting_set --app=$app --key=wifi_device --value="${wifi_device}"
ynh_app_setting_set --app=$app --key=wifi_channel --value="${wifi_channel}" ynh_app_setting_set --app=$app --key=wifi_channel --value="${wifi_channel}"
ynh_app_setting_set --app=$app --key=advanced --value=0 ynh_app_setting_set --app=$app --key=advanced --value=0
ynh_app_setting_set --app=$app --key=ip6_firewall --value=1 ynh_app_setting_set --app=$app --key=ip6_firewall --value=1
ynh_app_setting_set --app=$app --key=ip6_dns --value="${ip6_dns}"
ynh_app_setting_set --app=$app --key=ip6_net --value="${ip6_net}"
ynh_app_setting_set --app=$app --key=ip4_dns --value="${ip4_dns}" ynh_app_setting_set --app=$app --key=ip4_dns --value="${ip4_dns}"
ynh_app_setting_set --app=$app --key=ip4_nat_prefix --value="${ip4_nat_prefix}" ynh_app_setting_set --app=$app --key=ip4_nat_prefix --value="${ip4_nat_prefix}"
@ -188,6 +173,14 @@ ynh_add_config --template="../conf/openvpn_90-hotspot" --destination="/etc/openv
chmod 0755 "/etc/openvpn/scripts/route-up.d/90-${service_name}" chmod 0755 "/etc/openvpn/scripts/route-up.d/90-${service_name}"
chmod 0755 "/etc/openvpn/scripts/route-down.d/90-${service_name}" chmod 0755 "/etc/openvpn/scripts/route-down.d/90-${service_name}"
# Copy openvpn scripts
mkdir -pm 0755 /etc/openvpn/scripts
mkdir -pm 0755 /etc/openvpn/scripts/route-up.d
mkdir -pm 0755 /etc/openvpn/scripts/route-down.d
install -o root -g root -m 0755 ../conf/openvpn_90-hotspot /etc/openvpn/scripts/route-up.d/90-hotspot
install -o root -g root -m 0755 ../conf/openvpn_90-hotspot /etc/openvpn/scripts/route-down.d/90-hotspot
#================================================= #=================================================
# CONFIGURE HOSTAPD # CONFIGURE HOSTAPD
#================================================= #=================================================

View file

@ -235,6 +235,13 @@ ynh_add_config --template="../conf/openvpn_90-hotspot" --destination="/etc/openv
chmod 0755 "/etc/openvpn/scripts/route-up.d/90-${service_name}" chmod 0755 "/etc/openvpn/scripts/route-up.d/90-${service_name}"
chmod 0755 "/etc/openvpn/scripts/route-down.d/90-${service_name}" chmod 0755 "/etc/openvpn/scripts/route-down.d/90-${service_name}"
# Copy openvpn scripts
mkdir -pm 0755 /etc/openvpn/scripts
mkdir -pm 0755 /etc/openvpn/scripts/route-up.d
mkdir -pm 0755 /etc/openvpn/scripts/route-down.d
install -o root -g root -m 0755 ../conf/openvpn_90-hotspot /etc/openvpn/scripts/route-up.d/90-hotspot
install -o root -g root -m 0755 ../conf/openvpn_90-hotspot /etc/openvpn/scripts/route-down.d/90-hotspot
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================