Add script itself
This commit is contained in:
parent
577a2e6b91
commit
6fd9f78039
18
update_FDEVCalendar.bash
Executable file
18
update_FDEVCalendar.bash
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
cd /home/user2/projects_production/FDEVCommunityEventsMonitoring || { exit 1; echo "changing directory failed"; exit 1; }
|
||||
|
||||
http_response=$(curl -s -L -o calendar.json -w "%{http_code}" "https://calendar.zaonce.net/jsonapi/node/calendar_item")
|
||||
if [ $http_response != "200" ]; then
|
||||
git reset --hard | grep -v "HEAD is now at"
|
||||
exit 1
|
||||
|
||||
else
|
||||
cat calendar.json | python3 -m json.tool > .calendar.json
|
||||
mv .calendar.json calendar.json
|
||||
git add "calendar.json"
|
||||
git commit -m "commit" 2>/dev/null >/dev/null
|
||||
git push 2>/dev/null
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user