Update gl-inet.sh

This commit is contained in:
悟空的日常镜像仓库 2024-03-22 16:24:15 +08:00
parent 4a6ee50d88
commit 784168b151
1 changed files with 25 additions and 3 deletions

View File

@ -290,9 +290,7 @@ recovery_opkg_settings() {
wget -O /etc/opkg/distfeeds.conf ${mt2500a_opkg} wget -O /etc/opkg/distfeeds.conf ${mt2500a_opkg}
;; ;;
*6000*) *6000*)
echo "正在适配 这货居然内核降级了!" update_opkg_config
#mt6000_opkg="https://raw.githubusercontent.com/wukongdaily/gl-inet-onescript/master/mt-6000/distfeeds.conf"
#wget -O /etc/opkg/distfeeds.conf ${mt6000_opkg}
;; ;;
*) *)
echo "Router name does not contain '3000' 6000 or '2500'." echo "Router name does not contain '3000' 6000 or '2500'."
@ -300,6 +298,30 @@ recovery_opkg_settings() {
esac esac
} }
update_opkg_config() {
kernel_version=$(uname -r)
echo "MT-6000 kernel version: $kernel_version"
case $kernel_version in
5.4*)
mt6000_opkg="https://raw.githubusercontent.com/wukongdaily/gl-inet-onescript/master/mt-6000/distfeeds-5.4.conf"
;;
5.15*)
mt6000_opkg="https://raw.githubusercontent.com/wukongdaily/gl-inet-onescript/master/mt-6000/distfeeds.conf"
;;
*)
echo "Unsupported kernel version: $kernel_version"
return 1
;;
esac
wget -O /etc/opkg/distfeeds.conf ${mt6000_opkg}
if [ $? -eq 0 ]; then
echo "Opkg configuration updated successfully."
else
echo "Failed to update opkg configuration."
return 1
fi
}
do_luci_app_adguardhome() { do_luci_app_adguardhome() {
setup_software_source 0 setup_software_source 0
opkg remove gl-sdk4-ui-adguardhome opkg remove gl-sdk4-ui-adguardhome