diff --git a/conf/openvpn_90-hotspot b/conf/openvpn_90-hotspot index 98bb699..ce09c25 100644 --- a/conf/openvpn_90-hotspot +++ b/conf/openvpn_90-hotspot @@ -1,3 +1,3 @@ #!/bin/bash -systemctl restart __SERVICE_NAME__ +systemctl restart __SERVICE_NAME__ \ No newline at end of file diff --git a/scripts/install b/scripts/install index a8ebb60..924b7ee 100644 --- a/scripts/install +++ b/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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ce8da75..0810b57 100644 --- a/scripts/upgrade +++ b/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 #=================================================