diff options
-rwxr-xr-x | files/files/usr/local/sbin/dayled.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/files/files/usr/local/sbin/dayled.sh b/files/files/usr/local/sbin/dayled.sh index 415aa51..a575b22 100755 --- a/files/files/usr/local/sbin/dayled.sh +++ b/files/files/usr/local/sbin/dayled.sh | |||
@@ -6,13 +6,16 @@ offset="$(uci get dayled.@dayled[0].offset)" | |||
6 | twilight="$(uci get dayled.@dayled[0].twilight)" | 6 | twilight="$(uci get dayled.@dayled[0].twilight)" |
7 | 7 | ||
8 | act() { | 8 | act() { |
9 | sunwait $1 $twilight $offset $latitude $longitude >/dev/null | 9 | if [ "${1}" = "wait" ]; then |
10 | local state=$? | 10 | sunwait wait $twilight $offset $latitude $longitude && sleep 5 || sleep 3600 |
11 | if [ "$state" -eq 2 ]; then | 11 | fi |
12 | cat /sys/class/leds/blue\:dome/max_brightness > /sys/class/leds/blue\:dome/brightness | 12 | sunwait poll $twilight $offset $latitude $longitude >/dev/null |
13 | elif [ "$state" -eq 3 ]; then | 13 | local state=$? |
14 | echo 0 > /sys/class/leds/blue\:dome/brightness | 14 | if [ "$state" -eq 2 ]; then |
15 | fi | 15 | cat /sys/class/leds/blue\:dome/max_brightness > /sys/class/leds/blue\:dome/brightness |
16 | elif [ "$state" -eq 3 ]; then | ||
17 | echo 0 > /sys/class/leds/blue\:dome/brightness | ||
18 | fi | ||
16 | } | 19 | } |
17 | 20 | ||
18 | while | 21 | while |