-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.sh
More file actions
37 lines (29 loc) · 975 Bytes
/
Copy patha.sh
File metadata and controls
37 lines (29 loc) · 975 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
33
34
35
36
37
#!/usr/bin/env bash
# A quick shell script for running the commands I need to run so often
# set -x
# Function to print colored text
print_error() {
tput setaf 1; # Set text color to red
echo "ERROR: $1";
tput sgr0; # Reset text color
}
# Reset Git repository
git reset --hard
if [ $? -ne 0 ]; then
print_error "GIT RESET FAILED!"
# Reset permissions on scripts
exit 1
fi
# Pull from Git
git pull
if [ $? -ne 0 ]; then
print_error "GIT PULL FAILED!"
# If git pull fails, set permissions on scripts using find
find /home/pi/TideTracker_repo -type f \( -name "*.sh" -o -name "*.py" \) -exec chmod +x {} \;
exit 1
fi
# Set permissions on scripts
find /home/pi/TideTracker_repo -type f \( -name "*.sh" -o -name "*.py" \) -exec chmod +x {} \;
# Uncomment the following line if you want to run the Python script
# python3 0_boot_sense.py
# sudo /home/pi/TideTracker_repo/forked_wifi-connect-headless-rpi/scripts/del-run.sh