mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
fix dhcp cleanup
This commit is contained in:
parent
178da8da7b
commit
643d8eaf52
1 changed files with 4 additions and 4 deletions
|
@ -158,7 +158,7 @@ start_dhcpd() {
|
||||||
sed "s|__IP4_DNS__|${ip4_dns[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf
|
sed "s|__IP4_DNS__|${ip4_dns[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf
|
||||||
sed "s|__IP4_NAT_PREFIX__|${ip4_nat_prefix[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf
|
sed "s|__IP4_NAT_PREFIX__|${ip4_nat_prefix[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf
|
||||||
|
|
||||||
dnsmasq -C /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf -p0
|
dnsmasq -C /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf -p0 -x /run/dnsmasq/dnsmasq-dhcpv4-ssid${i}.pid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run DHCPv6 server
|
# Run DHCPv6 server
|
||||||
|
@ -171,7 +171,7 @@ start_dhcpd() {
|
||||||
sed "s|__IP6_DNS__|${ip6_dns[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf
|
sed "s|__IP6_DNS__|${ip6_dns[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf
|
||||||
sed "s|__IP6_NET__|${ip6_net[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf
|
sed "s|__IP6_NET__|${ip6_net[${i}]}|g" -i /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf
|
||||||
|
|
||||||
dnsmasq -C /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf -p0
|
dnsmasq -C /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf -p0 -x /run/dnsmasq/dnsmasq-dhcpv6-ssid${i}.pid
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,13 +249,13 @@ stop_dhcpd() {
|
||||||
if is_dhcpd6_running ${i}; then
|
if is_dhcpd6_running ${i}; then
|
||||||
echo "hotspot${i}: Stop the NDP and DHCPv6 server (dnsmasq)"
|
echo "hotspot${i}: Stop the NDP and DHCPv6 server (dnsmasq)"
|
||||||
kill $(ps aux | grep 'dhcpdv6-ssid' | grep -v grep | awk '{ print $2 }')
|
kill $(ps aux | grep 'dhcpdv6-ssid' | grep -v grep | awk '{ print $2 }')
|
||||||
rm -f /etc/dnsmasq.d/dhcpdv6-ssid*.conf
|
rm -f /etc/dnsmasq.dhcpd/dhcpdv6-ssid*.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_dhcpd4_running ${i}; then
|
if is_dhcpd4_running ${i}; then
|
||||||
echo "hotspot${i}: Stop the DHCPv4 server (dnsmasq)"
|
echo "hotspot${i}: Stop the DHCPv4 server (dnsmasq)"
|
||||||
kill $(ps aux | grep 'dhcpdv4-ssid' | grep -v grep | awk '{ print $2 }')
|
kill $(ps aux | grep 'dhcpdv4-ssid' | grep -v grep | awk '{ print $2 }')
|
||||||
rm -f /etc/dnsmasq.d/dhcpdv4-ssid*.conf
|
rm -f /etc/dnsmasq.dhcpd/dhcpdv4-ssid*.conf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue