aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/relayd/files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-09-17 21:45:30 +0000
committerJohn Crispin <john@openwrt.org>2013-09-17 21:45:30 +0000
commitf87409440298121ae1fbd718a17267cc180438e4 (patch)
tree2ceea2187fddf2c9fb21cb43a27d69afdd55e81f /package/network/services/relayd/files
parent4f62127dea854024116383c84fedb673baaae9cd (diff)
downloadupstream-f87409440298121ae1fbd718a17267cc180438e4.tar.gz
upstream-f87409440298121ae1fbd718a17267cc180438e4.tar.bz2
upstream-f87409440298121ae1fbd718a17267cc180438e4.zip
procd: convert various packages to procd style init.d scripts
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38023
Diffstat (limited to 'package/network/services/relayd/files')
-rw-r--r--package/network/services/relayd/files/relay.init35
1 files changed, 19 insertions, 16 deletions
diff --git a/package/network/services/relayd/files/relay.init b/package/network/services/relayd/files/relay.init
index 43ba6e10f4..edc419c0b9 100644
--- a/package/network/services/relayd/files/relay.init
+++ b/package/network/services/relayd/files/relay.init
@@ -2,9 +2,12 @@
# Copyright (c) 2011-2012 OpenWrt.org
START=80
+USE_PROCD=1
+PROG=/usr/sbin/relayd
+
resolve_ifname() {
grep -qs "^ *$1:" /proc/net/dev && {
- append args "-I $1"
+ procd_append_param command -I "$1"
append ifaces "$1"
}
}
@@ -37,6 +40,9 @@ start_relay() {
fi
}
+ procd_open_instance
+ procd_set_param command "$PROG"
+
local net networks
config_get networks "$cfg" network
for net in $networks; do
@@ -53,44 +59,41 @@ start_relay() {
local ipaddr
config_get ipaddr "$cfg" ipaddr
- [ -n "$ipaddr" ] && append args "-L $ipaddr"
+ [ -n "$ipaddr" ] && procd_append_param command -L "$ipaddr"
local gateway
config_get gateway "$cfg" gateway
- [ -n "$gateway" ] && append args "-G $gateway"
+ [ -n "$gateway" ] && procd_append_param command -G "$gateway"
local expiry # = 30
config_get expiry "$cfg" expiry
- [ -n "$expiry" ] && append args "-t $expiry"
+ [ -n "$expiry" ] && procd_append_param command "$expiry"
local retry # = 5
config_get retry "$cfg" retry
- [ -n "$retry" ] && append args "-p $retry"
+ [ -n "$retry" ] && procd_append_param command -p "$retry"
local table # = 16800
config_get table "$cfg" table
- [ -n "$table" ] && append args "-T $table"
+ [ -n "$table" ] && procd_append_param command -T "$table"
local fwd_bcast # = 1
config_get_bool fwd_bcast "$cfg" forward_bcast 1
- [ $fwd_bcast -eq 1 ] && append args "-B"
+ [ $fwd_bcast -eq 1 ] && procd_append_param command "-B"
local fwd_dhcp # = 1
config_get_bool fwd_dhcp "$cfg" forward_dhcp 1
- [ $fwd_dhcp -eq 1 ] && append args "-D"
+ [ $fwd_dhcp -eq 1 ] && procd_append_param command"-D"
- service_start /usr/sbin/relayd $args
+ procd_close_instance
}
-stop() {
- for pid in /var/run/relay-*.pid; do
- SERVICE_PID_FILE="$pid"
- service_stop /usr/sbin/relayd
- rm -f "$SERVICE_PID_FILE"
- done
+service_triggers()
+{
+ procd_add_reload_trigger "network"
}
-start() {
+start_service() {
include /lib/network
config_load network
config_foreach start_relay interface