Skip to content
Snippets Groups Projects
Commit 2567b533 authored by Adrian Schmutzler's avatar Adrian Schmutzler Committed by Tim Niemeyer
Browse files

vpn-select: Fix case of missing .pid file


Bug: If /tmp/run/fastd.${project}.pid is missing, the directory
/proc/ is checked instead of /proc/{something}.

Signed-off-by: default avatarAdrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: default avatarTim Niemeyer <tim@tn-x.org>
parent 4dbf136a
No related branches found
No related tags found
No related merge requests found
......@@ -79,10 +79,11 @@ if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null ||
/etc/init.d/fastd reload
# fastd start/stop for various situations
pidfile="/tmp/run/fastd.${project}.pid"
if [ "$(ls /etc/fastd/${project}/peers/* 2>/dev/null)" ]; then
[ -d /proc/$(cat /tmp/run/fastd.${project}.pid) ] || /etc/init.d/fastd start
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) || /etc/init.d/fastd start
else
[ -d /proc/$(cat /tmp/run/fastd.${project}.pid) ] && /etc/init.d/fastd stop
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) && /etc/init.d/fastd stop
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment