fix: null-coalescing operator: // "
This commit is contained in:
1 parent
b5c12800c3
commit
5d1f30f66e
2 files changed
+5
-5
No files matched your search
+1
-1
@@ -61,7 +61,7 @@ _merge_config_restart() {
|
||||
function clashsecret() {
|
||||
case "$#" in
|
||||
0)
|
||||
_okcat "当前密钥:$(sudo "$BIN_YQ" '.secret' "$CLASH_CONFIG_RUNTIME")"
|
||||
_okcat "当前密钥:$(sudo "$BIN_YQ" '.secret // ""' "$CLASH_CONFIG_RUNTIME")"
|
||||
;;
|
||||
1)
|
||||
local secret=$1
|
||||
|
||||
+4
-4
@@ -46,7 +46,7 @@ function _get_os() {
|
||||
CLASH_CRON_TAB='/var/spool/cron/crontabs/root'
|
||||
BASHRC='/etc/bash.bashrc'
|
||||
}
|
||||
|
||||
|
||||
_get_kernel
|
||||
local cpu_arch=$(uname -m)
|
||||
# shellcheck disable=SC2086
|
||||
@@ -54,9 +54,9 @@ function _get_os() {
|
||||
}
|
||||
|
||||
function _get_port() {
|
||||
local port=$(sudo $BIN_YQ '.port' $CLASH_CONFIG_RUNTIME)
|
||||
local mixed_port=$(sudo $BIN_YQ '.mixed-port' $CLASH_CONFIG_RUNTIME)
|
||||
local external_port=$(sudo $BIN_YQ '.external-controller' $CLASH_CONFIG_RUNTIME | cut -d':' -f2)
|
||||
local port=$(sudo $BIN_YQ '.port // ""' $CLASH_CONFIG_RUNTIME)
|
||||
local mixed_port=$(sudo $BIN_YQ '.mixed-port // ""' $CLASH_CONFIG_RUNTIME)
|
||||
local external_port=$(sudo $BIN_YQ '.external-controller // ""' $CLASH_CONFIG_RUNTIME | cut -d':' -f2)
|
||||
|
||||
PROXY_PORT="${mixed_port:-${port:-7890}}"
|
||||
UI_PORT=${external_port:-9090}
|
||||
|
||||
Reference in new issue
Block a user