feat: soft channel
This commit is contained in:
25
cattools.sh
25
cattools.sh
@@ -96,7 +96,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
|
||||||
@@ -267,7 +270,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
|
||||||
@@ -484,6 +486,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"
|
||||||
@@ -504,7 +507,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 "======================================================="
|
||||||
@@ -516,10 +519,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 "Source Channel : $channel_remote"
|
||||||
|
echo "Local Version : $version_local"
|
||||||
|
echo "Local Hash : $hash_local"
|
||||||
|
|
||||||
echo "======================================================="
|
echo "======================================================="
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
@@ -568,7 +573,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
|
||||||
@@ -1156,9 +1161,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
|
||||||
|
|||||||
Reference in New Issue
Block a user