Release v.1.0.25270.1 #1
@@ -7,6 +7,7 @@ BRANCH_NAME="develop"
|
||||
POLL_INTERVAL=60 # Seconds between checks
|
||||
#LOG_FILE="/var/log/git-monitor.log" # Log file for recording actions
|
||||
LOCK_FILE="/tmp/git-monitor.lock" # File to prevent multiple instances running concurrently
|
||||
IFS="|"
|
||||
|
||||
# Functions
|
||||
log_message() {
|
||||
@@ -38,7 +39,7 @@ run_after() {
|
||||
}
|
||||
|
||||
initialize_repos() {
|
||||
while IFS=: read -r REPO_NAME REPO_URL; do
|
||||
while read -r REPO_NAME REPO_URL; do
|
||||
if [ ! -d "$REPO_LOCAL_PATH/$REPO_NAME" ]; then
|
||||
log_message "INFO" "Repository directory does not exist. Cloning..."
|
||||
mkdir -p "$REPO_LOCAL_PATH"
|
||||
@@ -90,7 +91,7 @@ log_message "INFO" "Git monitor started."
|
||||
initialize_repo
|
||||
|
||||
while true; do
|
||||
while IFS=: read -r $REPO_NAME $REPO_URL; do
|
||||
while read -r $REPO_NAME $REPO_URL; do
|
||||
check_for_updates $REPO_NAME
|
||||
run_after "$REPO_LOCAL_PATH/$REPO_NAME/.git-monitor_after.sh"
|
||||
done < $REPO_URLS
|
||||
|
||||
Reference in New Issue
Block a user