all repos — dotfiles @ c6fa66c522f0378ea8d34959363a0fc98cce9274

linux dotfiles

org-autocommit-cron: add internet check
Prithu Goswami pg@prithu.dev
Sat, 16 Apr 2022 20:31:17 +0530
commit

c6fa66c522f0378ea8d34959363a0fc98cce9274

parent

57201602be3288e111b01630c7d2e244b4653cc0

1 files changed, 8 insertions(+), 4 deletions(-)

jump to
M bin/cron/org-autocommit-cronbin/cron/org-autocommit-cron

@@ -4,8 +4,12 @@ cd $HOME/docs/org

cmsg=$(git status -s) git add . && git commit -m "auto commit: $(whoami)@may"\ -m "$cmsg" -ping -q -c 1 google.com >/dev/null && git push && git push glix -cd $HOME -pass git remote | xargs -I B pass git pull B master -pass git remote | xargs -L1 pass git push +# check for connectivity before pushing +if nc -dzw1 google.com 443; then + git push && git push glix + cd $HOME + pass git remote | xargs -I B pass git pull B master + pass git remote | xargs -L1 pass git push +fi +