Commit 4dd26572 authored by Kolbjørn Barmen's avatar Kolbjørn Barmen
Browse files

Move pid file to /run/mp-rude.pids so it not present at boot

parent b0196b87
......@@ -8,7 +8,7 @@ apt-get update
apt-get -y upgrade
package="mp-rude"
version="1.3.5"
version="1.3.6"
#version=$(git describe|perl -p -e 'chomp;s/v([^-]+)(-(\d+)-g.+)?$/\1+\3/;s/\+$//')
......
......@@ -3,3 +3,4 @@ bin="/usr/share/mp-rude"
logpath="/var/lib/mp-rude"
trace="${bin}"/trace.sh
traceconf="/etc/mp-rude/trace.conf"
pidfile="/run/mp-rude.pids"
......@@ -6,14 +6,15 @@ set -e
log="${logpath}"/"${date}"/"traceroute_$1"
if [ -f "${logpath}"/pids ] ; then
echo "ERROR: ${logpath}/pids already exists!"
pidfile=${pidfile:-/run/mp-rude.pids}
if [ -f "${pidfile}" ] ; then
echo "ERROR: ${pidfile} already exists!"
exit 1
fi
#Start traceroute
for i in $(cat ${traceconf}) ; do
${trace} ${i} 23:59 > /dev/null 2>&1 &
echo "$!" >> "${logpath}"/pids
echo "$!" >> "${pidfile}"
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment