home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / sredird / telnetcpcd-1.09.tar.gz / telnetcpcd-1.09.tar / rc.telnetcpcd < prev    next >
Text File  |  2003-08-12  |  772b  |  44 lines

  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/init.d/telnetcpcd        starts telnetcpcd
  4. #
  5. # Copyright (c) 2002,2003 Thomas J Pinkl <tom@pinkl.com>
  6. #
  7. # chkconfig: 2345 89 11
  8. # description: telnetcpcd is the Telnet Com Port Control daemon
  9.  
  10. ARG1="$1"
  11. ARGS="$@"
  12.  
  13. # Source function library.
  14. . /etc/rc.d/init.d/functions
  15.  
  16. TNCPCD="/usr/local/sbin/telnetcpcd"
  17. CONF="/etc/telnetcpcd.conf"
  18. [ -x $TNCPCD -a -f $CONF ] || exit 
  19.  
  20. # See how we were called.
  21. case "$ARG1" in
  22.   start)
  23.     echo -n "Starting telnetcpcd: "
  24.     daemon $TNCPCD -d -c $CONF
  25.     touch /var/lock/subsys/telnetcpcd
  26.     echo
  27.     ;;
  28.   stop)
  29.     echo -n "Shutting down telnetcpcd: "
  30.     killproc telnetcpcd
  31.     rm -f /var/lock/subsys/telnetcpcd
  32.     echo
  33.     ;;
  34.   restart)
  35.     $0 stop
  36.     $0 start
  37.     ;;
  38.   *)
  39.     echo "Usage: telnetcpcd {start|stop|restart}"
  40.     exit 1
  41. esac
  42.  
  43. exit 0
  44.