START/STOP values must be specified in the init script
[openwrt-10.03/.git] / package / busybox / files / telnet
index c994c6052fa983929ee344a2ac831c5fd6f07718..58025840298e6cb058a83e65fb47699af4aed754 100755 (executable)
@@ -1,8 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
+START=50
 
 start() {
-       if awk -F: '/^root:/ && $2 !~ /\!/ {exit 1}' /etc/passwd 2>/dev/null && [ -x /usr/sbin/dropbear ]; then telnetd -l /bin/login; fi
+       if      [ \! -f /etc/passwd ] || \
+               awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null || \
+               [ \! -x /usr/sbin/dropbear ]
+       then \
+               telnetd -l /bin/login
+       fi
 }
 
 stop() {