Merge branch 'master' of git://repo.or.cz/buildroot
[buildroot.git] / package / tftpd / S80tftpd-hpa
blob41c28d148d4882f0742436c7b31b3511faeeb0a4
1 #! /bin/sh
3 OPTIONS="-c -l -s /var/lib/tftpboot"
5 set -e
7 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
8 DESC="HPA's tftpd"
9 NAME=in.tftpd
10 DAEMON=/usr/sbin/$NAME
11 PIDFILE=/var/run/$NAME.pid
12 SCRIPTNAME=/etc/init.d/S80tftpd-hpa
15 # Function that starts the daemon/service.
17 d_start() {
18 mkdir -p /var/lib/tftpboot
19 chmod 1777 /var/lib/tftpboot
20 $DAEMON $OPTIONS
24 # Function that stops the daemon/service.
26 d_stop() {
27 killall -q $NAME
31 # Function that sends a SIGHUP to the daemon/service.
33 d_reload() {
34 d_start
35 d_stop
38 case "$1" in
39 start)
40 echo -n "Starting $DESC: "
41 d_start
42 echo "done"
44 stop)
45 echo -n "Stopping $DESC: "
46 d_stop
47 echo "done"
49 #reload)
51 # If the daemon can reload its configuration without
52 # restarting (for example, when it is sent a SIGHUP),
53 # then implement that here.
55 # If the daemon responds to changes in its config file
56 # directly anyway, make this an "exit 0".
58 # echo -n "Reloading $DESC configuration..."
59 # d_reload
60 # echo "done."
61 #;;
62 restart|force-reload)
64 # If the "reload" option is implemented, move the "force-reload"
65 # option to the "reload" entry above. If not, "force-reload" is
66 # just the same as "restart".
68 echo -n "Restarting $DESC: "
69 d_stop
70 sleep 1
71 d_start
72 echo "done"
75 # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
76 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
77 exit 1
79 esac
81 exit 0