summaryrefslogtreecommitdiff
path: root/scripts/vyatta-monitor-background-stop
blob: c10528f5dfabe79f84f1c93ae3fef64930284da4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
declare pidname="$1"
pidfile="/var/run/vyatta/monitor/$pidname-`tty| sed -e s-/--g -e s/dev//g`.pid"
if [ -f $pidfile ]; then
  pid=$(cat $pidfile)
  processname=$(cat /proc/$pid/cmdline 2>/dev/null) 
  if [[ $processname =~ "tail" ]];then
   kill -9 $pid
   rm -f $pidfile
   exit 0
  fi
fi
echo -ne "\n  You are not currently monitoring this service\n\n"