vdotfiles

Cem's Dotfiles for Void Linux
git clone git://git.ckyln.com/vdotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3181ff1e38e6d14fbb5e25c49c05cc0ba53b8bc1
parent b2b88b20f2158082f1a8f63a95b9bb45576ef67f
Author: Cem Keylan <cem@ckyln.com>
Date:   Thu, 27 Jun 2019 22:09:25 +0300

no output

Diffstat:
Mbin/checksunset | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/checksunset b/bin/checksunset @@ -6,7 +6,7 @@ LON=33.046875 error() {\ echo "Error: $1" - exit + exit 1 } jq --version >/dev/null 2>&1 || error "You must install jq to continue (https://stedolan.github.io/jq/)" @@ -14,7 +14,7 @@ jq --version >/dev/null 2>&1 || error "You must install jq to continue (https:// [ -e $HOME/.sunset ] || touch $HOME/.sunset . $HOME/.sunset [ "$checkdate" = `date +%Y%m%d` ] && exit # Don't check anything if you have already checked today. -ping sunrise-sunset.org -c 1 -W 5 || exit +ping sunrise-sunset.org -c 1 -W 5 >/dev/null || exit 1 if [ -z $LAT ] || [ -z $LON ]; then PUBLIC_IP=`curl -s https://ipinfo.io/ip` LAT=$(curl -s https://ipvigilante.com/${PUBLIC_IP} | \ @@ -25,8 +25,8 @@ if [ -z $LAT ] || [ -z $LON ]; then fi -MORNING=$(date --date="TZ=\"UTC\" $(curl https://api.sunrise-sunset.org/json\?lat\=$LAT\&lng\=$LON\&date\=today | jq .results.sunrise | cut -c 2- | awk '{print $1}')" +%H%M) -NIGHT=$(date -d "$(date --date="TZ=\"UTC\" $(curl https://api.sunrise-sunset.org/json\?lat\=$LAT\&lng\=$LON\&date\=today | jq .results.sunset | cut -c 2- | awk '{print $1}')" +%H:%M) today + 12 hours" +%H%M) +MORNING=$(date --date="TZ=\"UTC\" $(curl -s https://api.sunrise-sunset.org/json\?lat\=$LAT\&lng\=$LON\&date\=today | jq .results.sunrise | cut -c 2- | awk '{print $1}')" +%H%M) +NIGHT=$(date -d "$(date --date="TZ=\"UTC\" $(curl -s https://api.sunrise-sunset.org/json\?lat\=$LAT\&lng\=$LON\&date\=today | jq .results.sunset | cut -c 2- | awk '{print $1}')" +%H:%M) today + 12 hours" +%H%M) printf "\ SUNRISE=$MORNING\n\