在国内编译OpenWrt很困难,有很多包被墙无法下载。我们提供了一个dl镜像的链接:
dl.zip原文连接:https://pan.baidu.com/s/1j9qZ2G7zyF7h5YF3nQJ4SA
本博客分享:
dl.zip + dl更新补丁包.zip
阿里云盘:https://www.aliyundrive.com/s/PvRsbNBRUs8https://www.aliyundrive.com/s/PvRsbNBRUs8https://www.aliyundrive.com/s/PvRsbNBRUs8https://www.aliyundrive.com/s/PvRsbNBRUs8「openWrt环境」https://www.aliyundrive.com/s/PvRsbNBRUs8 点击链接保存,或者复制本段内容,打开「阿里云盘」APP ,无需下载极速在线查看,视频原画倍速播放。
百度云盘:链接: https://pan.baidu.com/s/1Ae-11bMPW6uPFa1ens5VbQ 提取码: 3p1k
脚本功能:
dl目录文件包不停的更新,但是每次全量备份,浪费时间,脚本会比对本次和上次备份的文件差异。
只把新增的包打包备份。
所以,下包“dl.zip” 和“dl_日期.zip”更新文件都要下载。并全部解压到dl目录下。
脚本:
#!/bin/bash # Date:2022/03/12 # Date:2022/03/27 #查看dl.zip和lede/dl/文件夹,包的差异 #并自动复制打包 datetime=`date +"%Y%m%d"` # openwrt的主目录,双引号里修改成你自己openwrt(lede)的dl路径 openwrt_home=~/lede/dl/ ## 当前备份shell脚本所在目录,不用改,自动获取sh文件自己所在目录 sh_pwd=`pwd` #echo ${sh_pwd} ## 新建目录 if [ ! -d ~/dl ];then mkdir -p ${sh_pwd}/dl/ fi ##新建.last_bak_pkg_lists.txt文件 if [ ! -f .last_bak_pkg_lists.txt ];then echo " " >> .last_bak_pkg_lists.txt fi ##新建dl_${datetime}.zip_lists.txt文件 if [ ! -f dl_${datetime}.zip_lists.txt ];then echo " " >> dl_${datetime}.zip_lists.txt fi ## 列出本级当前openwrt(lede)/dl/目录文件 ls -1 ${openwrt_home} >.current_dl_lists_temp.txt ## 列出老的dl.zip包文件名 unzip -v ~/dl.zip |awk -F'/' '{print $2}' | grep -vE "^$" > .old_dl_zip_lists.txt ## 列出dl.zip包里目录内容,对比后,差异放入dl_${datetime}.zip_lists.txt #unzip -v dl.zip |awk -F'/' '{print $2}' |grep -v "`cat 2dl.txt`" <-- 错误的过滤顺序 cat .current_dl_lists_temp.txt| grep -v "`cat .old_dl_zip_lists.txt`"|grep -v "`cat .last_bak_pkg_lists.txt`"| grep -vE "^$" > dl_${datetime}.zip_lists.txt ## 备份列表空,则退出 num_list=`wc -l dl_${datetime}.zip_lists.txt| awk '{print $1}'` if [ ${num_list} -eq 0 ];then echo "" ### 清理已经备份的临时dl文件夹(不是你openwrt(lede)目录的dl文件夹) rm -rf dl/ ### 清理临时文件 rm -f .current_dl_lists_temp.txt .old_dl_zip_lists.txt dl_${datetime}.zip_lists.txt echo "[ info ] Back list is null . wc -l dl_${datetime}.zip_lists.txt = ${num_list}" echo "" exit fi ## 备份新包 cd ${openwrt_home} #pwd echo "[ info ] Begin copy 'dl_${datetime}.zip_lists.txt'" for file in `cat ${sh_pwd}/dl_${datetime}.zip_lists.txt` do \cp -ar ${file} ${sh_pwd}/dl/ done ##切换回sh文件所在目录 cd ${sh_pwd} pwd ##打包 zip -r dl_${datetime}.zip dl/ ## 本次备份过的列表追加到上一次列表中 ## 防止重复备份 cat ${sh_pwd}/dl_${datetime}.zip_lists.txt >> ${sh_pwd}/.last_bak_pkg_lists.txt ## 清理已经备份的临时dl文件夹(不是你openwrt(lede)目录的dl文件夹) rm -rf dl/ ## 清理临时文件 rm -f .current_dl_lists_temp.txt .old_dl_zip_lists.txt echo "" echo "[ info ] Backup ZIP file name : dl_${datetime}.zip" echo "[ info ] Backup ZIP lists log file name : dl_${datetime}.zip_lists.txt" echo "" echo "[ info ] Backup 'dl' pkg done." echo ""
dl文件链接下载来源: