Change writing and remove unneeded $

This commit is contained in:
2025-09-21 01:40:07 +02:00
parent 0a0e38e276
commit ccfea088b9

View File

@@ -35,11 +35,11 @@ run_after() {
} }
initialize_repos() { initialize_repos() {
while read -r REPO_NAME REPO_URL; do while read -r repo_name repo_url; do
if [ ! -d "$REPO_LOCAL_PATH/$REPO_NAME" ]; then if [ ! -d "$REPO_LOCAL_PATH/$repo_name" ]; then
log_message "INFO" "Repository directory $REPO_LOCAL_PATH/$REOP_NAME does not exist. Cloning..." log_message "INFO" "Repository directory $REPO_LOCAL_PATH/$REOP_NAME does not exist. Cloning..."
mkdir -p "$REPO_LOCAL_PATH/$REPO_NAME" mkdir -p "$REPO_LOCAL_PATH/$repo_name"
git clone --depth 1 "$REPO_URL" "$REPO_LOCAL_PATH/$REPO_NAME" git clone --depth 1 "$REPO_URL" "$REPO_LOCAL_PATH/$repo_name"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
log_message "ERROR" "Failed to clone repository. Exiting." log_message "ERROR" "Failed to clone repository. Exiting."
exit 1 exit 1
@@ -92,10 +92,10 @@ log_message "INFO" "Git monitor started."
initialize_repos initialize_repos
while true; do while true; do
while read -r $REPO_NAME $REPO_URL; do while read -r repo_name repo_url; do
check_for_updates $REPO_NAME check_for_updates $repo_name
if [ -f "$REPO_LOCAL_PATH/$REPO_NAME/.git-monitor_after.sh" ]; then if [ -f "$REPO_LOCAL_PATH/$repo_name/.git-monitor_after.sh" ]; then
run_after "$REPO_LOCAL_PATH/$REPO_NAME/.git-monitor_after.sh" run_after "$REPO_LOCAL_PATH/$repo_name/.git-monitor_after.sh"
fi fi
done < $REPO_URLS done < $REPO_URLS
sleep "$POLL_INTERVAL" sleep "$POLL_INTERVAL"