X-Git-Url: https://git.armaanb.net/?p=bin.git;a=blobdiff_plain;f=brownoutd;h=036fad771a44cce14bb489e5f24aec5139520804;hp=ad35e24b4126f15adf0ff1c8095990e8ff874730;hb=HEAD;hpb=a607ac3b05ce3c00efb21d65be6b24af56c2863a diff --git a/brownoutd b/brownoutd index ad35e24..036fad7 100755 --- a/brownoutd +++ b/brownoutd @@ -1,12 +1,16 @@ -#!/usr/bin/sh +#!/usr/bin/sh -e + +trap "exit" INT TERM EXIT while true; do - if is-day 42.4 -71.3 ; then + if is-day "${1:-42.4}" "${2:--71.3}"; then brownout 0 else brownout 650 fi - sleep 900 + sleep 900 & + wait $! done +