diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /package/busybox/files | |
download | trunk-36060-27b76ab0671089c47506615a796a261e993896a7.tar.gz trunk-36060-27b76ab0671089c47506615a796a261e993896a7.tar.bz2 trunk-36060-27b76ab0671089c47506615a796a261e993896a7.zip |
Diffstat (limited to 'package/busybox/files')
-rw-r--r-- | package/busybox/files/.svn/entries | 96 | ||||
-rw-r--r-- | package/busybox/files/.svn/prop-base/cron.svn-base | 9 | ||||
-rw-r--r-- | package/busybox/files/.svn/prop-base/telnet.svn-base | 9 | ||||
-rw-r--r-- | package/busybox/files/.svn/text-base/cron.svn-base | 18 | ||||
-rw-r--r-- | package/busybox/files/.svn/text-base/telnet.svn-base | 37 | ||||
-rwxr-xr-x | package/busybox/files/cron | 18 | ||||
-rwxr-xr-x | package/busybox/files/telnet | 37 |
7 files changed, 224 insertions, 0 deletions
diff --git a/package/busybox/files/.svn/entries b/package/busybox/files/.svn/entries new file mode 100644 index 0000000..d815495 --- /dev/null +++ b/package/busybox/files/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/package/busybox/files +svn://svn.openwrt.org/openwrt + + + +2011-11-16T13:17:35.851342Z +29183 +jow + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +cron +file + + + + +2013-03-17T12:13:09.000000Z +75e57cfa999797ca726eb3c2604bd712 +2011-11-07T22:58:39.735051Z +28836 +nico +has-props + + + + + + + + + + + + + + + + + + + + +385 + +telnet +file + + + + +2013-03-17T12:13:09.000000Z +78d40e5aaec0f57d9de5a3e7b51c9e4e +2011-11-16T13:17:35.851342Z +29183 +jow +has-props + + + + + + + + + + + + + + + + + + + + +878 + diff --git a/package/busybox/files/.svn/prop-base/cron.svn-base b/package/busybox/files/.svn/prop-base/cron.svn-base new file mode 100644 index 0000000..03b5bfa --- /dev/null +++ b/package/busybox/files/.svn/prop-base/cron.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 14 +svn:executable +V 1 +* +END diff --git a/package/busybox/files/.svn/prop-base/telnet.svn-base b/package/busybox/files/.svn/prop-base/telnet.svn-base new file mode 100644 index 0000000..03b5bfa --- /dev/null +++ b/package/busybox/files/.svn/prop-base/telnet.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 14 +svn:executable +V 1 +* +END diff --git a/package/busybox/files/.svn/text-base/cron.svn-base b/package/busybox/files/.svn/text-base/cron.svn-base new file mode 100644 index 0000000..465b1ab --- /dev/null +++ b/package/busybox/files/.svn/text-base/cron.svn-base @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start () { + loglevel=$(uci_get "system.@system[0].cronloglevel") + [ -z "$(ls /etc/crontabs/)" ] && exit 1 + mkdir -p /var/spool/cron + ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null + service_start /usr/sbin/crond -c /etc/crontabs -l ${loglevel:-5} +} + +stop() { + service_stop /usr/sbin/crond +} diff --git a/package/busybox/files/.svn/text-base/telnet.svn-base b/package/busybox/files/.svn/text-base/telnet.svn-base new file mode 100644 index 0000000..994e713 --- /dev/null +++ b/package/busybox/files/.svn/text-base/telnet.svn-base @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +has_root_pwd() { + local pwd=$([ -f "$1" ] && cat "$1") + pwd="${pwd#*root:}" + pwd="${pwd%%:*}" + + test -n "${pwd#[\!x]}" +} + +get_root_home() { + local homedir=$([ -f "$1" ] && cat "$1") + homedir="${homedir#*:*:0:0:*:}" + + echo "${homedir%%:*}" +} + +has_ssh_pubkey() { + ( /etc/init.d/dropbear enabled 2> /dev/null && grep -qs "^ssh-" /etc/dropbear/authorized_keys ) || \ + ( /etc/init.d/sshd enabled 2> /dev/null && grep -qs "^ssh-" "$(get_root_home /etc/passwd)"/.ssh/authorized_keys ) +} + +start() { + 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 + fi +} + +stop() { + service_stop /usr/sbin/telnetd +} diff --git a/package/busybox/files/cron b/package/busybox/files/cron new file mode 100755 index 0000000..465b1ab --- /dev/null +++ b/package/busybox/files/cron @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +start () { + loglevel=$(uci_get "system.@system[0].cronloglevel") + [ -z "$(ls /etc/crontabs/)" ] && exit 1 + mkdir -p /var/spool/cron + ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null + service_start /usr/sbin/crond -c /etc/crontabs -l ${loglevel:-5} +} + +stop() { + service_stop /usr/sbin/crond +} diff --git a/package/busybox/files/telnet b/package/busybox/files/telnet new file mode 100755 index 0000000..994e713 --- /dev/null +++ b/package/busybox/files/telnet @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=50 + +has_root_pwd() { + local pwd=$([ -f "$1" ] && cat "$1") + pwd="${pwd#*root:}" + pwd="${pwd%%:*}" + + test -n "${pwd#[\!x]}" +} + +get_root_home() { + local homedir=$([ -f "$1" ] && cat "$1") + homedir="${homedir#*:*:0:0:*:}" + + echo "${homedir%%:*}" +} + +has_ssh_pubkey() { + ( /etc/init.d/dropbear enabled 2> /dev/null && grep -qs "^ssh-" /etc/dropbear/authorized_keys ) || \ + ( /etc/init.d/sshd enabled 2> /dev/null && grep -qs "^ssh-" "$(get_root_home /etc/passwd)"/.ssh/authorized_keys ) +} + +start() { + 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 + fi +} + +stop() { + service_stop /usr/sbin/telnetd +} |