Skip to content

Commit

Permalink
Update adguardhome.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wukongdaily authored Jan 25, 2025
1 parent 346e809 commit ad7507a
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/adguardhome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,34 @@ jobs:
- name: Download luci-app-adguardhome IPK files
run: |
TARGET_URL="https://dl.openwrt.ai/$PACKAGE_VERSION/x86_64/kiddin9/"
FILE_PREFIX="luci-app-adguardhome"
curl -s "$TARGET_URL" | grep -oP "$FILE_PREFIX.*?\.ipk" | while read -r file; do
ARCHITECTURES=(
"AdGuardHome_aarch32=https://dl.openwrt.ai/$PACKAGE_VERSION/arm_cortex-a7/kiddin9/"
"AdGuardHome_aarch64=https://dl.openwrt.ai/$PACKAGE_VERSION/aarch64_cortex-a53/kiddin9/"
"AdGuardHome_x86_64=https://dl.openwrt.ai/$PACKAGE_VERSION/x86_64/kiddin9/")
# Process each architecture
for ARCH_MAPPING in "${ARCHITECTURES[@]}"; do
ARCH=$(echo "$ARCH_MAPPING" | cut -d= -f1)
TARGET_URL=$(echo "$ARCH_MAPPING" | cut -d= -f2)
# Ensure directories exist
mkdir -p "$ARCH/depends"
# Download luci-app-adguardhome ipk to the architecture folder
curl -s "$TARGET_URL" | grep -oP "luci-app-adguardhome.*?\.ipk" | while read -r file; do
new_file_name=$(echo "$file" | sed 's/~/_/g')
curl -o "$ARCH/$new_file_name" "$TARGET_URL$file"
ls "$ARCH/$new_file_name"
done
# Download adguardhome core ipk (but not luci-app-adguardhome) to the depends folder
curl -s "$TARGET_URL" | grep -oP "(?<!luci-app-)adguardhome.*?\.ipk" | while read -r file; do
new_file_name=$(echo "$file" | sed 's/~/_/g')
curl -o "AdGuardHome_aarch32/$new_file_name" "$TARGET_URL$file"
curl -o "AdGuardHome_aarch64/$new_file_name" "$TARGET_URL$file"
curl -o "AdGuardHome_x86_64/$new_file_name" "$TARGET_URL$file"
ls AdGuardHome_aarch32/$new_file_name
curl -o "$ARCH/depends/$new_file_name" "$TARGET_URL$file"
ls "$ARCH/depends/$new_file_name"
done
done
- name: Create install.sh scripts
run: |
cat <<EOF > AdGuardHome_x86_64/install.sh
Expand All @@ -79,7 +98,11 @@ jobs:
echo "update failed。"
exit 1
fi
# install AdGuardHome Core IPK
opkg install depends/*.ipk
# install luci-app-adguardhome IPK
opkg install *.ipk
# update latest AdGuardHome Core
cp AdGuardHome/AdGuardHome /usr/bin/AdGuardHome
chmod +x /usr/bin/AdGuardHome
EOF
Expand Down

0 comments on commit ad7507a

Please sign in to comment.