projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[tools/mkimage]: upgrade and build from the u-boot source
[openwrt.git]
/
package
/
wprobe
/
files
/
wprobe.init
diff --git
a/package/wprobe/files/wprobe.init
b/package/wprobe/files/wprobe.init
index
cf0b162
..
b35246d
100755
(executable)
--- a/
package/wprobe/files/wprobe.init
+++ b/
package/wprobe/files/wprobe.init
@@
-1,29
+1,36
@@
#!/bin/sh /etc/rc.common
START=90
#!/bin/sh /etc/rc.common
START=90
-EXPORTER=/usr/sbin/wprobe-ipfix
+EXPORTER=/sbin/wprobe-export
+UTIL=/sbin/wprobe-util
wprobe_ssd() {
wprobe_ssd() {
- local cfg="$1"; shift
local cmd="$1"; shift
local cmd="$1"; shift
- start-stop-daemon "$cmd" -p "/var/run/wprobe-$cfg.pid" -b -x "$EXPORTER" -m -- "$@"
+ local type="$1"; shift
+ local app="$1"; shift
+ start-stop-daemon "$cmd" -p "/var/run/wprobe-$type.pid" -b ${app:+-x "$app"} -m -- "$@"
}
stop_wprobe() {
}
stop_wprobe() {
- local
cfg
="$1"
- [ -f "/var/run/wprobe-$
cfg.pid" ] && wprobe_ssd "$cfg" -K
- rm -f "/var/run/wprobe-$
cfg
.pid"
+ local
type
="$1"
+ [ -f "/var/run/wprobe-$
type.pid" ] && wprobe_ssd -K "$type"
+ rm -f "/var/run/wprobe-$
type
.pid"
}
config_wprobe() {
config_get ifname "$cfg" ifname
config_get interval "$cfg" interval
[ -n "$interval" ] || interval=100
}
config_wprobe() {
config_get ifname "$cfg" ifname
config_get interval "$cfg" interval
[ -n "$interval" ] || interval=100
- wprobe-info "$ifname" -c -i "$interval"
+ $UTIL "$ifname" -i "$interval" 2>/dev/null >/dev/null
+}
+
+start_proxy() {
+ config_get port "$cfg" port
+ wprobe_ssd -S proxy "$UTIL" -P -p "${port:-17990}"
}
start_ipfix() {
local cfg="$1"
}
start_ipfix() {
local cfg="$1"
- config_get ifname "$cfg" i
nterfac
e
+ config_get ifname "$cfg" i
fnam
e
config_get host "$cfg" host
config_get port "$cfg" port
config_get proto "$cfg" proto
config_get host "$cfg" host
config_get port "$cfg" port
config_get proto "$cfg" proto
@@
-38,13
+45,15
@@
start_ipfix() {
return
}
config_wprobe "$cfg"
return
}
config_wprobe "$cfg"
- wprobe_ssd
"$cfg" -S
"$proto" -i "$ifname" -c "$host" -p "${port:-4739}"
+ wprobe_ssd
-S "export-$cfg" "$EXPORTER"
"$proto" -i "$ifname" -c "$host" -p "${port:-4739}"
}
start_export() {
}
start_export() {
+ local cfg="$1"
config_get export_type "$cfg" type
case "$export_type" in
config_get export_type "$cfg" type
case "$export_type" in
- ipfix) start_ipfix "$cfg";;
+ ipfix) [ -x "$EXPORTER" ] && start_ipfix "$cfg";;
+ wprobe) start_proxy "$cfg";;
esac
}
esac
}
@@
-59,5
+68,5
@@
stop() {
start() {
config_load wprobe
config_foreach config_wprobe interface
start() {
config_load wprobe
config_foreach config_wprobe interface
-
[ -x "$EXPORTER" ] &&
config_foreach start_export export
+ config_foreach start_export export
}
}
This page took
0.032365 seconds
and
4
git commands to generate.