#!/bin/sh
#this script will halt FSmud by killing FS's process

#get process PID(startfs && addr_server.fs && driver.fs)
FS_SERVERPID=$(/sbin/pidof -x addr_server.fs)
FS_DRIVERPID=$(/sbin/pidof -x driver.fs)
STARTFS_PID=$(/sbin/pidof -x startfs)

#stop FSmud process
if [ ! -x /bin/kill ];then
 echo 'can not excute file kill...file not exist'
 exit 1
fi
if [ -n $STARTFS_PID ];then
 /bin/kill -s 9 $STARTFS_PID
fi
if [ -n $FS_SERVERPID ];then
 /bin/kill -s 15 $FS_SERVERPID
fi
if [ -n $FS_DRIERPID ];then
 /bin/kill -s 15 $FS_DRIVERPID
fi
