1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008 OpenWrt.org
11 append cfgs "$cfg_name"
17 [ -d /tmp/bandwidthd ] || mkdir -p /tmp/bandwidthd && cp /www/legend.gif /tmp/bandwidthd/
18 [ -e /htdocs ] || ln -s /tmp/bandwidthd /htdocs
19 [ -e /www/bandwidthd ] || ln -s /tmp/bandwidthd /www/bandwidthd
20 rm -f /tmp/bandwidthd.conf
21 touch /tmp/bandwidthd.conf
22 [ -e /etc/bandwidthd.conf ] || ln -s /tmp/bandwidthd.conf /etc/bandwidthd.conf
25 config_load bandwidthd
27 config_get interface $cfg interface
28 config_get subnets $cfg interface
29 config_get skip_intervals $cfg skip_intervals
30 config_get graph_cutoff $cfg graph_cutoff
31 config_get promiscuous $cfg promiscuous
32 config_get output_cdf $cfg output_cdf
33 config_get recover_cdf $cfg recover_cdf
34 config_get filter $cfg filter
35 config_get graph $cfg graph
36 config_get meta_refresh $cfg meta_refresh
37 for subnet in $subnets; do
38 echo "subnet $subnet">> /tmp/bandwidthd.conf
40 cat >> /tmp/bandwidthd.conf <<EOF
41 ${interface:+ dev "$interface"}
42 ${skip_intervals:+ skip_intervals $skip_intervals}
43 ${graph_cutoff:+ graph_cutoff $graph_cutoff}
44 ${promiscuous:+ promiscuous $promiscuous}
45 ${output_cdf:+ output_cdf $output_cdf}
46 ${recover_cdf:+ recover_cdf $recover_cdf}
47 ${filter:+ filter $filter}
48 ${graph:+ graph $graph}
49 ${meta_refresh:+ meta_refresh $meta_refresh}