summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-01-09 15:03:17 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-01-09 15:03:17 +0100
commitf07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca (patch)
treec48e75b0ecb17c7eabc9f07421f782a6246c0faf /files
parent80ec5071c9b623bf7d026b62be31d8b16cdc8b03 (diff)
downloadap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar
ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar.gz
ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar.bz2
ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.tar.xz
ap01-f07d7b5d87adf8ef61b7cdc7b9ab3ef68876d9ca.zip
...
Diffstat (limited to 'files')
-rwxr-xr-xfiles/files/usr/local/sbin/dayled.sh17
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)"
6twilight="$(uci get dayled.@dayled[0].twilight)" 6twilight="$(uci get dayled.@dayled[0].twilight)"
7 7
8act() { 8act() {
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
18while 21while