-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·32 lines (24 loc) · 716 Bytes
/
run.sh
File metadata and controls
executable file
·32 lines (24 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
cd /home/pi/03.007_Design-Thinking-and-Innovation
COUNTER=1
while [ $COUNTER -lt 4 ]; do
echo "-------------"
echo "Check for internet (attempt $COUNTER)"
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
echo "IPv4 is up"
echo "IP Address: $(hostname -I)"
git stash
git pull git@github.com:iangohy/03.007_Design-Thinking-and-Innovation.git --rebase
break
else
echo "IPv4 is down"
fi
if [ $COUNTER = 3 ]; then
echo "Skipping update..."
break
fi
((COUNTER++))
echo "Waiting for 5 seconds before retrying..."
sleep 5
done
python3 /home/pi/03.007_Design-Thinking-and-Innovation/recyclace_thread.py