-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpull-git.sh
25 lines (22 loc) · 1.01 KB
/
pull-git.sh
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
#!/bin/bash
# Header
echo -e " "
echo -e "\033[0;34m───────────────────────────────────────────────\033[0m"
echo -e "\033[1;34m[Git] Checking & Updating Repository\033[0m"
echo -e "\033[0;34m───────────────────────────────────────────────\033[0m"
# [Git] Check if Git is installed
if command -v git > /dev/null 2>&1; then
echo -e "\033[0;37m[Git] Pulling latest changes for the 'www' folder...\033[0m"
cd /home/container/www
if [ -d .git ]; then
if git pull; then
echo -e "\033[0;32m[Git] Successfully updated repository.\033[0m"
else
echo -e "\033[0;31m[Git] Failed to pull latest changes.\033[0m"
fi
else
echo -e "\033[0;33m[Git] No Git repository found, skipping pull.\033[0m"
fi
else
echo -e "\033[0;31m[Git] Git is not installed, skipping update.\033[0m"
fi