[package] fix various init scripts
authorLuka Perkov <luka@openwrt.org>
Mon, 23 Sep 2013 21:58:36 +0000 (21:58 +0000)
committerLuka Perkov <luka@openwrt.org>
Mon, 23 Sep 2013 21:58:36 +0000 (21:58 +0000)
Changes include:

* removing unused variables
* replacing spaces with tabs where appropriate
* more consistency with variable declarations

Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 38142

package/network/services/dnsmasq/files/dnsmasq.init
package/network/services/dropbear/files/dropbear.init
package/network/services/relayd/files/relay.init
package/system/procd/files/log.init
package/utils/busybox/files/cron
package/utils/busybox/files/sysntpd
package/utils/busybox/files/telnet

index a0aee8e02b4efa3221c623ea659a2dfd1781111d..560928b7640fb4da1c82dc2e4d2b1f3d25abbbde 100644 (file)
@@ -75,7 +75,7 @@ append_addnhosts() {
 }
 
 append_bogusnxdomain() {
-    xappend "--bogus-nxdomain=$1"
+       xappend "--bogus-nxdomain=$1"
 }
 
 dnsmasq() {
index 728767f0309e39d15cf3f5c2476c094e168cae13..320a401e2e221efeccf7f9deb077a3e6c34e1d55 100755 (executable)
@@ -6,9 +6,8 @@ START=50
 STOP=50
 
 USE_PROCD=1
-
-NAME=dropbear
 PROG=/usr/sbin/dropbear
+NAME=dropbear
 PIDCOUNT=0
 EXTRA_COMMANDS="killclients"
 EXTRA_HELP="   killclients Kill ${NAME} processes except servers and yourself"
index edc419c0b9b4a062055f18b9267890236df5d88f..d73df6ab5522ab58a0d46f6b4137fdd54f4fa97e 100644 (file)
@@ -1,5 +1,6 @@
 #!/bin/sh /etc/rc.common
 # Copyright (c) 2011-2012 OpenWrt.org
+
 START=80
 
 USE_PROCD=1
@@ -40,8 +41,8 @@ start_relay() {
                fi
        }
 
-        procd_open_instance
-        procd_set_param command "$PROG"
+       procd_open_instance
+       procd_set_param command "$PROG"
 
        local net networks
        config_get networks "$cfg" network
@@ -83,7 +84,7 @@ start_relay() {
 
        local fwd_dhcp # = 1
        config_get_bool fwd_dhcp "$cfg" forward_dhcp 1
-       [ $fwd_dhcp -eq 1 ] && procd_append_param command"-D"
+       [ $fwd_dhcp -eq 1 ] && procd_append_param command "-D"
 
        procd_close_instance
 }
index 14fbdf8c5493f969b62b96d28b3c8e1dd99b28bf..d0e3025714ba76737840d623513dee87c92b1388 100644 (file)
@@ -6,7 +6,6 @@ START=21
 STOP=89
 
 USE_PROCD=1
-NAME=logread
 PROG=/sbin/logread
 
 start_service_file()
@@ -15,13 +14,13 @@ start_service_file()
        local log_file log_size
 
        config_get log_file $1 log_file
-        config_get log_size $1 log_size
+       config_get log_size $1 log_size
 
        [ -z "${log_file}" ] && return
 
        procd_open_instance
        procd_set_param command "$PROG" -f -F "$log_file" -p "$pid_file"
-        [ -n "${log_size}" ] && procd_append_param command -S "$log_size"
+       [ -n "${log_size}" ] && procd_append_param command -S "$log_size"
        procd_close_instance
 }
 
@@ -38,7 +37,7 @@ start_service_remote()
 
        procd_open_instance
        procd_set_param command "$PROG" -f -r "$log_ip" "${log_port:-514}" -p "$pid_file"
-        [ "${log_proto}" != "udp" ] || procd_append_param command -u
+       [ "${log_proto}" != "udp" ] || procd_append_param command -u
        procd_close_instance
 }
 
index fa368098c29e4195502f6b7e934040623f2b8dec..5e6b4bf3feb52b372feaba2ca58765c55bd69510 100755 (executable)
@@ -5,7 +5,6 @@ START=50
 
 USE_PROCD=1
 PROG=/usr/sbin/crond
-NAME=crond
 
 start_service () {
        [ -z "$(ls /etc/crontabs/)" ] && return 1
index d7a9807a87d144abcf8d82c8eea071e293b24faa..ebdda63df96dd10fcf102cea9eed2c385094213c 100755 (executable)
@@ -5,7 +5,6 @@ START=98
 
 USE_PROCD=1
 PROG=/usr/sbin/ntpd
-SERVICE_PID_FILE=/var/run/sysntpd.pid
 
 start_service() {
        local peers
@@ -20,7 +19,7 @@ start_service() {
 
        procd_open_instance
        procd_set_param command "$PROG" -n
-        [ $enable_server -ne 0 ] && procd_append_param command -l
+       [ $enable_server -ne 0 ] && procd_append_param command -l
        [ -n "$peers" ] && {
                local peer
                for peer in $peers; do
index 8ffd904078e98ce6503d2fa9484357c753c7e53b..a1d1cdf9b18d69895e7a08a8b1318f1ff591ea07 100755 (executable)
@@ -2,9 +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")
@@ -31,8 +31,8 @@ start_service() {
             ! 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
-               procd_open_instance
-               procd_set_param command "$PROG" -F -l /bin/login.sh
+               procd_open_instance
+               procd_set_param command "$PROG" -F -l /bin/login.sh
                procd_close_instance
        fi
 }