diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-09 15:03:17 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-09 15:03:17 +0100 |
commit | f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca (patch) | |
tree | c48e75b0ecb17c7eabc9f07421f782a6246c0faf /files | |
parent | 80ec5071c9b623bf7d026b62be31d8b16cdc8b03 (diff) | |
download | ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar.gz ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar.bz2 ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar.xz ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.zip |
...
Diffstat (limited to 'files')
-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 |