awips2/RadarServer/build.rcm/bits/bin/stop
Steve Harris 8485b90ff8 12.4.1-10 baseline
Former-commit-id: bf53d06834caa780226121334ac1bcf0534c3f16
2012-05-01 18:06:13 -05:00

26 lines
601 B
Bash

#!/bin/sh
exe=$0
while test -L "$exe"; do
exe=`readlink "$exe"`
done
bin_dir=`dirname "$exe"`
bin_dir=`cd "$bin_dir";pwd`
rs_home_dir=`cd "$bin_dir/..";pwd`
pid_file=$rs_home_dir/data/radarserver-pid
if [ -f $pid_file ]
then
pid=`cat "$pid_file"`
if test -n "$pid"; then
rm -f "$pid_file"
if kill "$pid"; then
echo "Killing radar server at process $pid, also removing pid file."
exit 0
fi
else
echo "Cannot find pid of radar server, please kill it manually."
fi
else
echo "File does not exist to find pid. It may not be running or it might need to be killed manually."
fi
exit 1