mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
add docker all feeds soft
This commit is contained in:
parent
4ff1102a1a
commit
4b2ee656b7
178 changed files with 15534 additions and 0 deletions
30
luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh
Executable file
30
luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -f /usr/share/adbyby/data/*.bak
|
||||
|
||||
touch /tmp/local-md5.json && md5sum /usr/share/adbyby/data/lazy.txt /usr/share/adbyby/data/video.txt > /tmp/local-md5.json
|
||||
touch /tmp/md5.json && uclient-fetch --no-check-certificate -T 10 -O /tmp/md5.json https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/md5.json
|
||||
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
lazy_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '2p')
|
||||
video_online=$(sed 's/":"/\n/g' /tmp/md5.json | sed 's/","/\n/g' | sed -n '4p')
|
||||
|
||||
if [ "$lazy_online"x != "$lazy_local"x -o "$video_online"x != "$video_local"x ]; then
|
||||
echo "MD5 not match! Need update!"
|
||||
touch /tmp/lazy.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt
|
||||
touch /tmp/video.txt && uclient-fetch --no-check-certificate -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt
|
||||
touch /tmp/local-md5.json && md5sum /tmp/lazy.txt /tmp/video.txt > /tmp/local-md5.json
|
||||
lazy_local=$(grep 'lazy' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
video_local=$(grep 'video' /tmp/local-md5.json | awk -F' ' '{print $1}')
|
||||
if [ "$lazy_online"x == "$lazy_local"x -a "$video_online"x == "$video_local"x ]; then
|
||||
echo "New rules MD5 match!"
|
||||
mv /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt
|
||||
mv /tmp/video.txt /usr/share/adbyby/data/video.txt
|
||||
echo $(date +"%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated
|
||||
fi
|
||||
else
|
||||
echo "MD5 match! No need to update!"
|
||||
fi
|
||||
|
||||
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/local-md5.json /tmp/md5.json
|
||||
Loading…
Add table
Add a link
Reference in a new issue