Browse Source

Merge branch 'testing' into remove_multissid

Alexandre Aubin 1 year ago
parent
commit
3be5d12a97
3 changed files with 16 additions and 16 deletions
  1. 1 1
      conf/openvpn_90-hotspot
  2. 8 15
      scripts/install
  3. 7 0
      scripts/upgrade

+ 1 - 1
conf/openvpn_90-hotspot

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-systemctl restart __SERVICE_NAME__
+systemctl restart __SERVICE_NAME__

+ 8 - 15
scripts/install

@@ -117,19 +117,6 @@ ynh_system_user_create --username=$app
 #=================================================
 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##*__}
 if [[ "${ip4_nat_prefix_index}" == "${app}" ]]; then
   	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=advanced --value=0
 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_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-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
 #=================================================

+ 7 - 0
scripts/upgrade

@@ -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-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
 #=================================================