Skip to content
Permalink
Browse files

dl_check.sh: now can de-duplicate local mirror

  • Loading branch information...
ryzhovau committed Mar 16, 2018
1 parent 02fa9ee commit 1f58198c95887a1f98852915e4e66dc8832fe130
Showing with 20 additions and 0 deletions.
  1. +20 −0 dl_check.sh
@@ -15,3 +15,23 @@ for entware_target in $(ls -1 configs); do
fi
done
done

mirrors="http://sources.lede-project.org \
http://mirror2.openwrt.org/sources \
http://downloads.openwrt.org/sources"

echo 'Creating upload mirror...'
mkdir -p dl.2upload
cp dl/* dl.2upload

echo 'Deduplicating local mirror...'
for src in $(ls -1 dl); do
for mirror in $mirrors; do
wget --quiet --spider $mirror/$src
if [ $? -eq 0 ]; then
echo "$src found @ $mirror"
rm -f "dl.2upload/$src"
break
fi
done
done

0 comments on commit 1f58198

Please sign in to comment.
You can’t perform that action at this time.