Merge pull request #10 from ttimochan/main

feat: soft channel
This commit is contained in:
喵二
2024-07-15 22:49:34 +08:00
committed by GitHub

View File

@@ -98,7 +98,10 @@ while [[ "$#" -gt 0 ]]; do
-help) help ;; -help) help ;;
-u) skip_update=true ;; -u) skip_update=true ;;
-update) skip_update=true ;; -update) skip_update=true ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;; *)
echo "Unknown parameter passed: $1"
exit 1
;;
esac esac
shift shift
done done
@@ -269,7 +272,6 @@ network_wizard() {
uci set network.lan._orig_ifname="$bridge_ports" uci set network.lan._orig_ifname="$bridge_ports"
uci set network.lan._orig_bridge='true' uci set network.lan._orig_bridge='true'
echo "Network interfaces configured: WAN (eth0), LAN ($bridge_ports) /// 网口已配置: WAN (eth0), LAN ($bridge_ports)" echo "Network interfaces configured: WAN (eth0), LAN ($bridge_ports) /// 网口已配置: WAN (eth0), LAN ($bridge_ports)"
fi fi
else else
@@ -486,6 +488,7 @@ catwrt_update() {
arch_self=$1 arch_self=$1
version_remote=$(curl -s "$API_URL" | jq -r ".$arch_self.version") version_remote=$(curl -s "$API_URL" | jq -r ".$arch_self.version")
hash_remote=$(curl -s "$API_URL" | jq -r ".$arch_self.hash") hash_remote=$(curl -s "$API_URL" | jq -r ".$arch_self.hash")
channel_remote=$(curl -s "$API_URL" | jq -r ".$arch_self.channel")
if [ $? -ne 0 ] || [ -z "$version_remote" ] || [ -z "$hash_remote" ]; then if [ $? -ne 0 ] || [ -z "$version_remote" ] || [ -z "$hash_remote" ]; then
remote_error "version or hash" remote_error "version or hash"
@@ -506,7 +509,7 @@ catwrt_update() {
contrast_version() { contrast_version() {
if [ "$version_remote" == "$version_local" ] && [ "$hash_remote" == "$hash_local" ]; then if [ "$version_remote" == "$version_local" ] && [ "$hash_remote" == "$hash_local" ]; then
echo "=======================================================" echo "======================================================="
echo " Your CatWrt is up to date!" echo "Your CatWrt is up to date! Also, you are using $channel_remote channel."
echo "=======================================================" echo "======================================================="
else else
echo "=======================================================" echo "======================================================="
@@ -518,10 +521,12 @@ catwrt_update() {
} }
print_version() { print_version() {
echo "Local Version : $version_local"
echo "Remote Version : $version_remote"
echo "Local Hash : $hash_local"
echo "Remote Hash : $hash_remote" echo "Remote Hash : $hash_remote"
echo "Remote Version : $version_remote"
echo "Remote Current Channel : $channel_remote"
echo "Local Version : $version_local"
echo "Local Hash : $hash_local"
echo "=======================================================" echo "======================================================="
echo "" echo ""
} }
@@ -570,7 +575,7 @@ apply_repo() {
;; ;;
esac esac
else else
echo "`/etc/catwrt_release` or `/etc/openwrt_release` Files do not exist /// 文件不存在或者系统损坏!" echo "$(/etc/catwrt_release) or $(/etc/openwrt_release) Files do not exist /// 文件不存在或者系统损坏!"
exit 1 exit 1
fi fi
fi fi
@@ -851,6 +856,13 @@ sysupgrade(){
firmware_url=$AMD64_BIOS_SYSUP firmware_url=$AMD64_BIOS_SYSUP
fi fi
if [ -f /etc/catwrt_opkg_list_installed ]; then
rm /etc/catwrt_opkg_list_installed
fi
catwrt_opkg_list_installed
echo "已经生成备份软件包列表,方便你后续更新后恢复部分消失的插件和软件"
echo "" echo ""
echo "Warning:" echo "Warning:"
echo "=========================================================================" echo "========================================================================="
@@ -1351,9 +1363,9 @@ manual_deploy_uhttpd_ssl_cert() {
return return
fi fi
if ! grep -q "list listen_http '0.0.0.0:80'" /etc/config/uhttpd || \ if ! grep -q "list listen_http '0.0.0.0:80'" /etc/config/uhttpd ||
! grep -q "list listen_http '\[::\]:80'" /etc/config/uhttpd || \ ! grep -q "list listen_http '\[::\]:80'" /etc/config/uhttpd ||
! grep -q "list listen_https '0.0.0.0:443'" /etc/config/uhttpd || \ ! grep -q "list listen_https '0.0.0.0:443'" /etc/config/uhttpd ||
! grep -q "list listen_https '\[::\]:443'" /etc/config/uhttpd; then ! grep -q "list listen_https '\[::\]:443'" /etc/config/uhttpd; then
echo "[ERROR] uhttpd 配置文件中的监听端口配置已被修改,请检查!" echo "[ERROR] uhttpd 配置文件中的监听端口配置已被修改,请检查!"
fi fi