#!/bin/sh

mks_start() {
  if [ -x /usr/sbin/mksd ]; then
    /usr/sbin/mksd
  fi
}

mks_stop() {
  killall mksd 2> /dev/null
}

mks_restart() {
  killall -9 mksd
  sleep 1
  rm /var/run/mksd/mksd.pid
  /usr/sbin/mksd
}

case "$1" in
'start')
  mks_start
  ;;
'stop')
  mks_stop
  ;;
'restart')
  mks_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac
