#!/bin/sh
exec_option=$1

if [[ X"$exec_option" = X"start" ]] || [[ X"$exec_option" = X"restart" ]]
then
	pid=`pidof easycwmpd`
	if [ X"$pid" != X"" ]
        then
    	    kill -9 $pid
        fi
	easycwmpd -f -g &
	if [ "$?" != "0" ]
	then
	    exit 1
	fi
elif [[ X"$exec_option" = X"stop" ]]
then
	pid=`pidof easycwmpd`
	if [ X"$pid" != X"" ]
        then
    	   kill -9 $pid
        fi
fi
