1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-17 21:59:55 +00:00

Don't use PID file but rather "pidof pihole-FTL" for detecting if another process is already running

This commit is contained in:
DL6ER 2017-04-12 19:34:13 +02:00
parent 3eacfa9831
commit fcd92d27f7
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -13,11 +13,11 @@ FTLUSER=pihole
PIDFILE=/var/run/pihole-FTL.pid PIDFILE=/var/run/pihole-FTL.pid
get_pid() { get_pid() {
cat "$PIDFILE" pidof "pihole-FTL"
} }
is_running() { is_running() {
[ -f "$PIDFILE" ] && ps "$(get_pid)" > /dev/null 2>&1 ps "$(get_pid)" > /dev/null 2>&1
} }
# Start the service # Start the service