1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2013 OpenWrt.org
4 # start after and stop before networking
14 local pid_file
="/var/run/logread.${PIDCOUNT}.pid"
15 local log_file log_size
17 config_get log_file
$1 log_file
18 config_get log_size
$1 log_size
20 [ -z "${log_file}" ] && return
23 procd_set_param
command "$PROG" -f -F "$log_file" -p "$pid_file"
24 [ -n "${log_size}" ] && procd_append_param
command -S "$log_size"
28 start_service_remote
()
30 local pid_file
="/var/run/logread.${PIDCOUNT}.pid"
31 local log_ip log_port log_proto
33 config_get log_ip
$1 log_ip
34 config_get log_port
$1 log_port
35 config_get log_proto
$1 log_proto udp
37 [ -z "${log_ip}" ] && return
40 procd_set_param
command "$PROG" -f -r "$log_ip" "${log_port:-514}" -p "$pid_file"
41 [ "${log_proto}" != "udp" ] || procd_append_param
command -u
47 procd_add_config_trigger
"system" "/etc/init.d/log" "start"
53 config_foreach start_service_file system
54 config_foreach start_service_remote system