#!/bin/sh

APP_NAME=rfsn
if dirname "$0" 1>/dev/null 2>/dev/null; then
    SH_DIR="$(cd "$(dirname "$0")";pwd)"
    cd $SH_DIR
fi
. ./$APP_NAME-inc.sh
init_env

if [ -f /tmp/$APP_NAME-daemon.pid ]; then
   $sudoprefix kill `cat /tmp/$APP_NAME-daemon.pid`
   $sudoprefix rm /tmp/$APP_NAME-daemon.pid
fi

if [ x"$(uname -s)" = x"Darwin" ]; then
    ps ax | grep $APP_NAME-daemon | grep -v grep | cut -d " " -f 1 | $sudoprefix xargs kill 2>/dev/null
fi

$sudoprefix killall $APP_NAME 2>/dev/null
sleep 2 2>/dev/null
$sudoprefix killall -9 $APP_NAME 2>/dev/null

