diff options
Diffstat (limited to 'scripts/vyatta-monitor-background-stop')
-rwxr-xr-x | scripts/vyatta-monitor-background-stop | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/vyatta-monitor-background-stop b/scripts/vyatta-monitor-background-stop new file mode 100755 index 0000000..c10528f --- /dev/null +++ b/scripts/vyatta-monitor-background-stop @@ -0,0 +1,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" |