mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-27 05:28:37 -06:00
Improved lockfile creation
This commit is contained in:
parent
8d2295c38b
commit
a12dc70eda
1 changed files with 2 additions and 1 deletions
|
@ -31,10 +31,11 @@ if [ "$1" == "crontab" ]; then
|
||||||
if test -f /tmp/brightness-crontab; then
|
if test -f /tmp/brightness-crontab; then
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
touch /tmp/brightness-crontab
|
|
||||||
if [ $(sunwait poll $latitude $longitude) == "DAY" ]; then
|
if [ $(sunwait poll $latitude $longitude) == "DAY" ]; then
|
||||||
|
echo "Waiting for sunset at" $(sunwait report 35.221050N 97.445938W | grep "Daylight:" | awk '{print $6}') > /tmp/brightness-crontab
|
||||||
sunwait wait set offset 10 $latitude $longitude && ddcutil setvcp 10 40
|
sunwait wait set offset 10 $latitude $longitude && ddcutil setvcp 10 40
|
||||||
else
|
else
|
||||||
|
echo "Waiting for sunrise at" $(sunwait report 35.221050N 97.445938W | grep "Daylight:" | awk '{print $4}') > /tmp/brightness-crontab
|
||||||
sunwait wait rise offset 10 $latitude $longitude && ddcutil setvcp 10 70
|
sunwait wait rise offset 10 $latitude $longitude && ddcutil setvcp 10 70
|
||||||
fi
|
fi
|
||||||
rm /tmp/brightness-crontab
|
rm /tmp/brightness-crontab
|
||||||
|
|
Loading…
Reference in a new issue