2015-07-13 11:05:36 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Start telnet....
|
|
|
|
#
|
|
|
|
|
2016-11-07 17:05:12 +01:00
|
|
|
TELNETD_ARGS=-F
|
|
|
|
[ -r /etc/default/telnet ] && . /etc/default/telnet
|
|
|
|
|
2015-07-13 11:05:36 +02:00
|
|
|
start() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Starting telnetd: "
|
2015-07-13 11:05:36 +02:00
|
|
|
start-stop-daemon -S -q -m -b -p /var/run/telnetd.pid \
|
2016-11-07 17:05:12 +01:00
|
|
|
-x /usr/sbin/telnetd -- $TELNETD_ARGS
|
2015-07-13 11:05:36 +02:00
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Stopping telnetd: "
|
2015-07-13 11:05:36 +02:00
|
|
|
start-stop-daemon -K -q -p /var/run/telnetd.pid \
|
|
|
|
-x /usr/sbin/telnetd
|
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|