feat: soft channel

This commit is contained in:
timochan
2024-07-15 22:19:05 +08:00
parent f9277d801d
commit 3788d3d92c

View File

@@ -96,7 +96,10 @@ while [[ "$#" -gt 0 ]]; do
-help) help ;;
-u) skip_update=true ;;
-update) skip_update=true ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
*)
echo "Unknown parameter passed: $1"
exit 1
;;
esac
shift
done
@@ -267,7 +270,6 @@ network_wizard() {
uci set network.lan._orig_ifname="$bridge_ports"
uci set network.lan._orig_bridge='true'
echo "Network interfaces configured: WAN (eth0), LAN ($bridge_ports) /// 网口已配置: WAN (eth0), LAN ($bridge_ports)"
fi
else
@@ -484,6 +486,7 @@ catwrt_update() {
arch_self=$1
version_remote=$(curl -s "$API_URL" | jq -r ".$arch_self.version")
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
remote_error "version or hash"
@@ -504,7 +507,7 @@ catwrt_update() {
contrast_version() {
if [ "$version_remote" == "$version_local" ] && [ "$hash_remote" == "$hash_local" ]; then
echo "======================================================="
echo " Your CatWrt is up to date!"
echo " Your CatWrt is up to date! Also, you are using $channel_remote channel."
echo "======================================================="
else
echo "======================================================="
@@ -516,10 +519,12 @@ catwrt_update() {
}
print_version() {
echo "Local Version : $version_local"
echo "Remote Version : $version_remote"
echo "Local Hash : $hash_local"
echo "Remote Hash : $hash_remote"
echo "Remote Version : $version_remote"
echo "Source Channel : $channel_remote"
echo "Local Version : $version_local"
echo "Local Hash : $hash_local"
echo "======================================================="
echo ""
}
@@ -568,7 +573,7 @@ apply_repo() {
;;
esac
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
fi
fi
@@ -1156,9 +1161,9 @@ manual_deploy_uhttpd_ssl_cert() {
return
fi
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_https '0.0.0.0:443'" /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_https '0.0.0.0:443'" /etc/config/uhttpd ||
! grep -q "list listen_https '\[::\]:443'" /etc/config/uhttpd; then
echo "[ERROR] uhttpd 配置文件中的监听端口配置已被修改,请检查!"
fi