wol: cosmetic changes
git-svn-id: svn://svn.openwrt.org/openwrt/packages@8850 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
82911a59e5
commit
46279bdce8
@ -1,3 +1,3 @@
|
||||
config wol-target
|
||||
option mac ''
|
||||
option enabled '0'
|
||||
option mac ''
|
||||
option enabled '0'
|
||||
|
@ -4,27 +4,27 @@
|
||||
START=60
|
||||
|
||||
append_string() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local value="$3"
|
||||
local _val
|
||||
config_get _val "$section" "$option"
|
||||
[ -n "$_val" ] && append args "$3$_val"
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local value="$3"
|
||||
local _val
|
||||
config_get _val "$section" "$option"
|
||||
[ -n "$_val" ] && append args "$3$_val"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local cfg="$1"
|
||||
args=""
|
||||
local cfg="$1"
|
||||
args=""
|
||||
|
||||
append_string "$cfg" broadcast "--host="
|
||||
append_string "$cfg" port "--port="
|
||||
append_string "$cfg" password "--passwd="
|
||||
append_string "$cfg" mac ""
|
||||
config_get_bool enabled "$cfg" "enabled" '1'
|
||||
[ "$enabled" -gt 0 ] && /usr/bin/wol $args
|
||||
append_string "$cfg" broadcast "--host="
|
||||
append_string "$cfg" port "--port="
|
||||
append_string "$cfg" password "--passwd="
|
||||
append_string "$cfg" mac ""
|
||||
config_get_bool enabled "$cfg" "enabled" '1'
|
||||
[ "$enabled" -gt 0 ] && /usr/bin/wol $args
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load wol
|
||||
config_foreach start_service wol-target
|
||||
config_load wol
|
||||
config_foreach start_service wol-target
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user