#!/bin/sh
#
#   "SystemImager"
#
#   Copyright (C) 2002-2004  Brian Elliott Finley
#
#   $Id: systemimager-server-netbootmond 2924 2004-10-20 14:19:56Z brianfinley $
#
#
# Support for IRIX style chkconfig:
# chkconfig:   2345 20 20
# description: The SystemImager si_netbootmond daemon.
#
#
# Support for LSB compliant init system:
### BEGIN INIT INFO
# Provides: si_netbootmond
# Required-Start: $network $syslog
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Short-Description: SystemImager's daemon for net boot control
# Description: SystemImager's daemon for controlling netboot clients.
#              If clients are configured to always boot from the network, 
#              si_netbootmond can be configured to tell them to boot off their
#              local disks each time they boot after having completed a 
#              successful autoinstall.
#
### END INIT INFO


PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:
PIDFILE=/var/run/si_netbootmond.pid

case "$1" in
  start)
    echo -n "Starting SystemImager's net boot client monitor: si_netbootmond"
    si_netbootmond
    echo "."
    ;;
  stop)
    echo -n "Stopping SystemImager's net boot client monitor: si_netbootmond"
    [ -f $PIDFILE ] && kill `cat $PIDFILE`
    echo "."
    ;;
  reload)
    echo "Not implemented."
    ;;
  force-reload|restart)
    sh $0 stop
    sh $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
    ;;
esac

exit 0
