From 675adbcecc36be2933628de52ce074d356dfb276 Mon Sep 17 00:00:00 2001 From: oib Date: Sat, 12 Apr 2025 10:08:15 +0200 Subject: [PATCH] Update 2025-04-12_10:08:15 --- pull_gitea_push.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 pull_gitea_push.sh diff --git a/pull_gitea_push.sh b/pull_gitea_push.sh new file mode 100755 index 0000000..a4a2e2f --- /dev/null +++ b/pull_gitea_push.sh @@ -0,0 +1,29 @@ +#!/bin/zsh +# Script Version: 01 +# Description: Pulls the latest gitea_push.sh from Gitea into ~/scripts and makes it executable + +# Set variables +# ======== +GITEA_RAW_URL="https://gitea.bubuit.net/oib/at2-scripts/raw/branch/main/gitea_push.sh" +LOCAL_DIR="$HOME/scripts" +LOCAL_PATH="$LOCAL_DIR/gitea_push.sh" + +# Ensure scripts directory exists +# ======== +if [ ! -d "$LOCAL_DIR" ]; then + echo "[INFO] Creating directory $LOCAL_DIR" + mkdir -p "$LOCAL_DIR" +fi + +# Main Process +# ======== +echo "[INFO] Downloading gitea_push.sh from Gitea" +curl -L "$GITEA_RAW_URL" -o "$LOCAL_PATH" + +if [ $? -eq 0 ]; then + chmod +x "$LOCAL_PATH" + echo "[INFO] gitea_push.sh downloaded and made executable at $LOCAL_PATH" +else + echo "[ERROR] Failed to download gitea_push.sh" +fi +