add scripts

This commit is contained in:
2025-11-08 10:28:02 -05:00
parent 718d82aabc
commit 299f39d3f2
7 changed files with 717 additions and 0 deletions

40
add-external-repos.sh Normal file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
# Update or clone specified OpenWRT package repositories
set -e # Exit immediately if any command fails
umask 022 # Set default file permissions (files=644, dirs=755)
# Define repositories in the format: "git_url branch local_dir"
REPOS=(
"https://github.com/muink/luci-app-netspeedtest.git master package/luci-app-netspeedtest"
"https://github.com/EasyTier/luci-app-easytier.git main package/luci-app-easytier"
)
for REPO_INFO in "${REPOS[@]}"; do
set -- $REPO_INFO
REPO_URL=$1
REPO_BRANCH=$2
LOCAL_DIR=$3
echo "----------------------------------------"
echo "Processing $LOCAL_DIR ($REPO_BRANCH)"
echo "----------------------------------------"
if [ -d "$LOCAL_DIR/.git" ]; then
echo "Repository exists, updating..."
pushd "$LOCAL_DIR" > /dev/null
git fetch origin "$REPO_BRANCH"
git checkout "$REPO_BRANCH"
git pull --ff-only origin "$REPO_BRANCH"
popd > /dev/null
else
echo "Repository not found, cloning..."
git clone --depth 1 --branch "$REPO_BRANCH" --single-branch "$REPO_URL" "$LOCAL_DIR"
fi
echo "Done: $LOCAL_DIR"
echo
done
echo "✅ All repositories updated successfully."