mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
ensure process from pid is running and remove pid file
This commit is contained in:
parent
c1246b4963
commit
dceb955917
1 changed files with 4 additions and 2 deletions
|
@ -73,13 +73,13 @@ is_forwarding_set() {
|
||||||
is_dhcpd6_running() {
|
is_dhcpd6_running() {
|
||||||
local i=${1}
|
local i=${1}
|
||||||
|
|
||||||
[[ -e "/run/dnsmasq/dnsmasq-dhcpdv6-ssid${i}.pid" ]]
|
[[ -e "/run/dnsmasq/dnsmasq-dhcpdv6-ssid${i}.pid" ]] && ps -p $(cat "/run/dnsmasq/dnsmasq-dhcpdv6-ssid${i}.pid") > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
is_dhcpd4_running() {
|
is_dhcpd4_running() {
|
||||||
local i=${1}
|
local i=${1}
|
||||||
|
|
||||||
[[ -e "/run/dnsmasq/dnsmasq-dhcpdv4-ssid${i}.pid" ]]
|
[[ -e "/run/dnsmasq/dnsmasq-dhcpdv4-ssid${i}.pid" ]] && ps -p $(cat "/run/dnsmasq/dnsmasq-dhcpdv4-ssid${i}.pid") > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
is_hostapd_running() {
|
is_hostapd_running() {
|
||||||
|
@ -249,12 +249,14 @@ 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 $(cat /run/dnsmasq/dnsmasq-dhcpdv6-ssid${i}.pid)
|
kill $(cat /run/dnsmasq/dnsmasq-dhcpdv6-ssid${i}.pid)
|
||||||
|
rm -f /run/dnsmasq/dnsmasq-dhcpdv6-ssid${1}.pid
|
||||||
rm -f /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.conf
|
rm -f /etc/dnsmasq.dhcpd/dhcpdv6-ssid${i}.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 $(cat /run/dnsmasq/dnsmasq-dhcpdv4-ssid${i}.pid)
|
kill $(cat /run/dnsmasq/dnsmasq-dhcpdv4-ssid${i}.pid)
|
||||||
|
rm -f /run/dnsmasq/dnsmasq-dhcpdv4-ssid${1}.pid
|
||||||
rm -f /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf
|
rm -f /etc/dnsmasq.dhcpd/dhcpdv4-ssid${i}.conf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue