busybox: allow the user to set the telnetd options
authorMichael Walle <michael@walle.cc>
Mon, 7 Nov 2016 16:05:12 +0000 (17:05 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 7 Nov 2016 21:58:04 +0000 (22:58 +0100)
Source /etc/default/telnet to make it possible to override the telnetd
arguments. For example a user may want to set an alternative port.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/busybox/S50telnet

index 47e2b63e19ded1099fac2b2c04e1840406384cf1..82952b8cb80480a7f458519c7c32dc084deef451 100755 (executable)
@@ -3,10 +3,13 @@
 # Start telnet....
 #
 
+TELNETD_ARGS=-F
+[ -r /etc/default/telnet ] && . /etc/default/telnet
+
 start() {
       printf "Starting telnetd: "
       start-stop-daemon -S -q -m -b -p /var/run/telnetd.pid \
-                       -x /usr/sbin/telnetd -- -F
+                       -x /usr/sbin/telnetd -- $TELNETD_ARGS
       [ $? = 0 ] && echo "OK" || echo "FAIL"
 }