选项6增加恢复原厂软件源OPKG功能

解决首页出现软件源错误
或者opkg update 失败的问题
This commit is contained in:
wukongdaily 2023-10-16 10:09:07 +08:00
parent 9d56e2cf12
commit 72b673413a
1 changed files with 26 additions and 0 deletions

View File

@ -277,6 +277,27 @@ rollback_old_version() {
"$local_file_path" "$local_file_path"
} }
recovery_opkg_settings() {
echo "# add your custom package feeds here" >/etc/opkg/customfeeds.conf
router_name=$(get_router_name)
case "$router_name" in
*3000*)
echo "Router name contains '3000'."
mt3000_opkg="https://raw.githubusercontent.com/wukongdaily/gl-inet-onescript/master/mt-3000/distfeeds.conf"
wget -O /etc/opkg/distfeeds.conf ${proxy_github}${mt3000_opkg}
;;
*2500*)
echo "Router name contains '2500'."
mt2500a_opkg="https://raw.githubusercontent.com/wukongdaily/gl-inet-onescript/master/mt-2500a/distfeeds.conf"
wget -O /etc/opkg/distfeeds.conf ${proxy_github}${mt2500a_opkg}
;;
*)
echo "Router name does not contain '3000' or '2500'."
;;
esac
echo "Tips: 重启路由器后才能完全生效"
}
while true; do while true; do
clear clear
echo "***********************************************************************" echo "***********************************************************************"
@ -298,6 +319,8 @@ while true; do
echo echo
echo " 5. 设置风扇开始工作的温度" echo " 5. 设置风扇开始工作的温度"
echo echo
echo " 6. 恢复原厂OPKG配置(软件包)"
echo
echo " Q. 退出本程序" echo " Q. 退出本程序"
echo echo
read -p "请选择一个选项: " choice read -p "请选择一个选项: " choice
@ -330,6 +353,9 @@ while true; do
5) 5)
set_glfan_temp set_glfan_temp
;; ;;
6)
recovery_opkg_settings
;;
h | H) h | H)
rollback_old_version rollback_old_version
exit 0 exit 0