diff --git a/be3600.sh b/be3600.sh index 8c7a6bb..496308f 100755 --- a/be3600.sh +++ b/be3600.sh @@ -47,46 +47,28 @@ install_istore_os_style() { UPDATED_CONTENT=$(echo "$CONTENT" | sed "s/DISTRIB_DESCRIPTION='[^']*'/DISTRIB_DESCRIPTION='$NEW_DESCRIPTION'/") echo "$UPDATED_CONTENT" >$FILE_PATH } -# 安装iStore 参考 https://github.com/linkease/istore +# 安装iStore do_istore() { echo "do_istore method==================>" - ISTORE_REPO=https://istore.linkease.com/repo/all/store - FCURL="curl --fail --show-error" - curl -V >/dev/null 2>&1 || { - echo "prereq: install curl" - opkg info curl | grep -Fqm1 curl || opkg update - opkg install curl - } + # 定义目标 URL 和本地目录 + URL="https://repo.istoreos.com/repo/all/store/" + DIR="/tmp/ipk_store" - IPK=$($FCURL "$ISTORE_REPO/Packages.gz" | zcat | grep -m1 '^Filename: luci-app-store.*\.ipk$' | sed -n -e 's/^Filename: \(.\+\)$/\1/p') + # 创建目录 + mkdir -p "$DIR" + cd "$DIR" || exit 1 - [ -n "$IPK" ] || exit 1 + for ipk in $(wget -qO- "$URL" | grep -oE 'href="[^"]+\.ipk"' | cut -d'"' -f2); do + echo "下载 $ipk" + wget -q "${URL}${ipk}" + done - $FCURL "$ISTORE_REPO/$IPK" | tar -xzO ./data.tar.gz | tar -xzO ./bin/is-opkg >/tmp/is-opkg + # 安装所有下载的 .ipk 包 + opkg install ./*.ipk - [ -s "/tmp/is-opkg" ] || exit 1 - - chmod 755 /tmp/is-opkg - /tmp/is-opkg update - # /tmp/is-opkg install taskd - /tmp/is-opkg opkg install --force-reinstall luci-lib-taskd luci-lib-xterm - /tmp/is-opkg opkg install --force-reinstall luci-app-store || exit $? - [ -s "/etc/init.d/tasks" ] || /tmp/is-opkg opkg install --force-reinstall taskd - [ -s "/usr/lib/lua/luci/cbi.lua" ] || /tmp/is-opkg opkg install luci-compat >/dev/null 2>&1 - } -#设置风扇工作温度 -setup_cpu_fans() { - #设定温度阀值,cpu高于48度,则风扇开始工作 - uci set glfan.@globals[0].temperature=48 - uci set glfan.@globals[0].warn_temperature=48 - uci set glfan.@globals[0].integration=4 - uci set glfan.@globals[0].differential=20 - uci commit glfan - /etc/init.d/gl_fan restart -} # 判断系统是否为iStoreOS is_iStoreOS() { @@ -212,66 +194,6 @@ check_whiptail_installed() { fi } -#定义一个通用的Dialog -show_whiptail_dialog() { - #判断是否具备whiptail dialog组件 - if check_whiptail_installed; then - echo "whiptail has installed" - else - echo "# add your custom package feeds here" >/etc/opkg/customfeeds.conf - opkg update - opkg install whiptail - fi - local title="$1" - local message="$2" - local function_definition="$3" - whiptail --title "$title" --yesno "$message" 15 60 --yes-button "是" --no-button "否" - if [ $? -eq 0 ]; then - eval "$function_definition" - else - echo "退出" - exit 0 - fi -} - -# 执行重启操作 -do_reboot() { - reboot -} - -#提示用户要重启 -show_reboot_tips() { - reboot_code='do_reboot' - show_whiptail_dialog "重启提醒" " $(get_router_hostname)\n 一键风格化运行完成.\n 为了更好的清理临时缓存,\n 您是否要重启路由器?" "$reboot_code" -} - -#自定义风扇开始工作的温度 -set_glfan_temp() { - - is_integer() { - if [[ $1 =~ ^[0-9]+$ ]]; then - return 0 # 是整数 - else - return 1 # 不是整数 - fi - } - echo "兼容带风扇机型的GL-iNet路由器" - echo "请输入风扇开始工作的温度(建议40-70之间的整数):" - read temp - - if is_integer "$temp"; then - uci set glfan.@globals[0].temperature="$temp" - uci set glfan.@globals[0].warn_temperature="$temp" - uci set glfan.@globals[0].integration=4 - uci set glfan.@globals[0].differential=20 - uci commit glfan - /etc/init.d/gl_fan restart - echo "设置成功!稍等片刻,请查看风扇转动情况" - else - echo "错误: 请输入整数." - fi -} - recovery_opkg_settings() { echo "# add your custom package feeds here" >/etc/opkg/customfeeds.conf router_name=$(get_router_name) @@ -326,38 +248,6 @@ update_opkg_config() { esac } -do_luci_app_adguardhome() { - setup_software_source 0 - opkg remove gl-sdk4-adguardhome --force-removal-of-dependent-packages - green "请访问 https://github.com/wukongdaily/RunFilesBuilder/" - green "自行生成带内核最新版luci-app-adguradhome的run安装包 然后在iStore安装" -} - -do_luci_app_wireguard() { - setup_software_source 0 - opkg install luci-app-wireguard - opkg install luci-i18n-wireguard-zh-cn - echo "请访问 http://"$(uci get network.lan.ipaddr)"/cgi-bin/luci/admin/status/wireguard 查看状态 " - echo "也可以去接口中 查看是否增加了新的wireguard 协议的选项 " -} -update_luci_app_quickstart() { - if [ -f "/bin/is-opkg" ]; then - # 如果 /bin/is-opkg 存在,则执行 is-opkg update - is-opkg update - is-opkg install luci-i18n-quickstart-zh-cn --force-depends >/dev/null 2>&1 - opkg install iptables-mod-tproxy - opkg install iptables-mod-socket - opkg install iptables-mod-iprange - yellow "恭喜您!现在你的路由器已经变成iStoreOS风格啦!" - green "现在您可以访问8080端口 查看是否生效 http://192.168.8.1:8080" - green "更多up主项目和动态 请务必收藏我的导航站 https://tvhelper.cpolar.top " - green "赞助本项目作者 https://wkdaily.cpolar.top/01 " - addr_hostname=$(uci get system.@system[0].hostname) - else - red "请先执行第一项 一键iStoreOS风格化" - fi -} - # 安装体积非常小的文件传输软件 默认上传位置/tmp/upload/ do_install_filetransfer() { mkdir -p /tmp/luci-app-filetransfer/