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 +