fix script when google returning 404
This commit is contained in:
parent
2956c9ccf3
commit
a3d05b5f08
@ -2,11 +2,24 @@
|
||||
|
||||
cd ~/CEC_monitoring || { exit 1; echo "changing directory failed"; exit 1; }
|
||||
|
||||
curl -L -o "list.csv" -s "https://docs.google.com/spreadsheets/d/e/2PACX-1vTXE8HCavThmJt1Wshy3GyF2ZJ-264SbNRVucsPUe2rbEgpm-e3tqsX-8K2mwsG4ozBj6qUyOOd4RMe/pub?gid=1832580214&single=true&output=csv" || { echo "downloading failed"; exit 1; }
|
||||
http_response=$(curl -s -L -o list.csv -w "%{http_code}" "https://docs.google.com/spreadsheets/d/e/2PACX-1vTXE8HCavThmJt1Wshy3GyF2ZJ-264SbNRVucsPUe2rbEgpm-e3tqsX-8K2mwsG4ozBj6qUyOOd4RMe/pub?gid=1832580214&single=true&output=csv")
|
||||
if [ $http_response != "200" ]; then
|
||||
echo "page not found"
|
||||
cat list.csv
|
||||
git reset --hard
|
||||
exit 1
|
||||
|
||||
git diff "list.csv"
|
||||
git add "list.csv"
|
||||
git commit -m "commit" | grep -vE 'On branch master|nothing to commit, working tree clean'
|
||||
else
|
||||
git diff "list.csv"
|
||||
git add "list.csv"
|
||||
git commit -m "commit" | grep -vE 'On branch master|nothing to commit, working tree clean'
|
||||
fi
|
||||
|
||||
#curl -L -o "list.csv" -s "https://docs.google.com/spreadsheets/d/e/2PACX-1vTXE8HCavThmJt1Wshy3GyF2ZJ-264SbNRVucsPUe2rbEgpm-e3tqsX-8K2mwsG4ozBj6qUyOOd4RMe/pub?gid=1832580214&single=true&output=csv" || { echo "downloading failed"; exit 1; }
|
||||
|
||||
#git diff "list.csv"
|
||||
#git add "list.csv"
|
||||
#git commit -m "commit" | grep -vE 'On branch master|nothing to commit, working tree clean'
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user