Commit ef3546a1 authored by Kolbjørn Barmen's avatar Kolbjørn Barmen

Mange små endringer - stop.sh skal liksom fjerne pidfila, så da er det

best at start-sh failer dersom pidfila eksisterer.
parent 25be7999
......@@ -2,12 +2,14 @@
set -e
source /etc/mp-rude/start.conf
. /etc/mp-rude/start.conf
log="${logpath}"/"${date}"/"traceroute_$1"
#Empty the pid file
echo > $logpath/pids
if [ -f "${logpath}"/pids ] ; then
echo "ERROR: ${logpath}/pids already exists!"
exit 1
fi
#Start traceroute
for i in $(cat ${traceconf}) ; do
......
#!/bin/bash
#! /bin/sh
source /etc/mp-rude/start.conf
set -e
if [ ! -e $logpath/pids ]
. /etc/mp-rude/start.conf
if [ ! -e "${logpath}"/pids ]
then
echo "Pid file does not exist: $logpath/pids"
echo "Pid file does not exist: ${logpath}/pids"
exit
fi
......@@ -14,5 +16,4 @@ fi
for i in $(cat $logpath/pids); do kill $i; done
rm $logpath/pids
rm -f "${logpath}"/pids
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