diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-07-11 17:00:26 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-07-11 17:00:26 +0000 |
commit | 9d97eb8b5776e2fbaa6e69b25313c04b2a0a9112 (patch) | |
tree | 0438aafe73d0be6cbee4be88f9ff5d4f99a2423a /package/utils | |
parent | 9919175aa2b947d2c9cc41b18bc247cac0aa7546 (diff) |
busybox: convert telnet init script to procd
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37242 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/utils')
-rwxr-xr-x | package/utils/busybox/files/telnet | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/package/utils/busybox/files/telnet b/package/utils/busybox/files/telnet index 994e713e70..8ffd904078 100755 --- a/package/utils/busybox/files/telnet +++ b/package/utils/busybox/files/telnet @@ -2,6 +2,9 @@ # Copyright (C) 2006-2011 OpenWrt.org START=50 +USE_PROCD=1 +PROG=/usr/sbin/telnetd +NAME=telnetd has_root_pwd() { local pwd=$([ -f "$1" ] && cat "$1") @@ -23,15 +26,13 @@ has_ssh_pubkey() { ( /etc/init.d/sshd enabled 2> /dev/null && grep -qs "^ssh-" "$(get_root_home /etc/passwd)"/.ssh/authorized_keys ) } -start() { +start_service() { if ( ! has_ssh_pubkey && \ ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \ ( ! /etc/init.d/dropbear enabled 2> /dev/null && ! /etc/init.d/sshd enabled 2> /dev/null ); then - service_start /usr/sbin/telnetd -l /bin/login.sh + procd_open_instance + procd_set_param command "$PROG" -F -l /bin/login.sh + procd_close_instance fi } - -stop() { - service_stop /usr/sbin/telnetd -} |