« Squid + NTLMTomcat Install Notes »

TFTPD Service Control Script

07/26/04

Permalink 07:35:10 am, by admin Email , 152 words   English (US)
Categories: Linux, Service Control Scripts

TFTPD Service Control Script

#!/bin/bash
# tftp - tftp server
#
# chkconfig: - 50 50
# description: tftp server in standalone mode
#
# processname: /usr/sbin/in.tftpd
#

# source function library
. /etc/init.d/functions

# settings start
ADDRESS="192.168.2.1"
DIR="/opt/tftproot"

# settings end

OPTIONS="-v -l -a $ADDRESS -s $DIR"
RETVAL=0
prog="in.tftpd"

start() {
        echo -n $"Starting $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                daemon /usr/sbin/in.tftpd $OPTIONS
                RETVAL=0
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tftpd
        fi;
        echo
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                killproc /usr/sbin/in.tftpd
                RETVAL=$?
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tftpd
        fi;
        echo
        return $RETVAL
}

reload(){
        stop
        start
}

restart(){
        stop
        start
}

condrestart(){
    [ -e /var/lock/subsys/tftpd ] && restart
    return 0
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  condrestart)
        condrestart
        ;;
  status)
        status in.tftpd
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        RETVAL=1
esac

exit $RETVAL

July 2010
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Reliable Penguin offers Linux Server Migrations, Systems Administration & Programming. Visit our main website at:

http://www.reliablepenguin.com

Search

Bookmark and Share

XML Feeds

powered by b2evolution