small-package/luci-app-bandwidthd/files/etc/init_bandwidthd.sh

13 lines
290 B
Bash
Raw Normal View History

2023-01-27 16:01:21 +08:00
#!/bin/sh /etc/rc.common
restart() {
enabled=$(uci get bandwidthd.@bandwidthd[0].enabled)
echo $enabled
if [ ! -z $enabled ] && [ $enabled == "1" ]
then
/etc/init.d/bandwidthd restart
/etc/init.d/bandwidthd enable
else
killall bandwidthd
/etc/init.d/bandwidthd disable
fi
}