blob: a0b1c1c1fa407fd3c7dc8c4c8c16c51d31543511 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/bin/sh
#
# Copyright (C) 2012 OpenWrt.org
#
COMMIT_SYSTEM=0
set_led_netdev() {
local cfg="led_$1"
local sysfs=$2
local dev=$3
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='netdev'
set system.$cfg.dev='$dev'
set system.$cfg.mode='link tx rx'
EOF
COMMIT_SYSTEM=1
}
set_led_default() {
local cfg="led_$1"
local sysfs=$2
local default=$3
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='none'
set system.$cfg.default='$default'
EOF
COMMIT_SYSTEM=1
}
. /lib/kirkwood.sh
hardware=$(kirkwood_hardware_name)
case "$hardware" in
"Seagate FreeAgent DockStar")
set_led_netdev "eth0" "dockstar:orange:misc" "eth0"
set_led_default "health" "dockstar:green:health" "1"
;;
*)
;;
esac
[ "$COMMIT_SYSTEM" == "1" ] && uci commit system
exit 0
|