This commit is contained in:
+20
-11
@@ -511,8 +511,8 @@ create() {
|
|||||||
old_remarks=$(grep -E '^[[:space:]]*//[[:space:]]*remarks:' $is_conf_dir/$is_config_file | sed 's/.*remarks:[[:space:]]*//')
|
old_remarks=$(grep -E '^[[:space:]]*//[[:space:]]*remarks:' $is_conf_dir/$is_config_file | sed 's/.*remarks:[[:space:]]*//')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local is_remarks=""
|
local is_remarks="${is_remarks:-}"
|
||||||
if [[ ! $is_gen ]]; then
|
if [[ ! $is_gen && ! $is_remarks ]]; then
|
||||||
if [[ $is_change ]]; then
|
if [[ $is_change ]]; then
|
||||||
if [[ $old_remarks ]]; then
|
if [[ $old_remarks ]]; then
|
||||||
msg "\n当前节点备注名称为: $old_remarks"
|
msg "\n当前节点备注名称为: $old_remarks"
|
||||||
@@ -1065,49 +1065,57 @@ add() {
|
|||||||
is_use_host=$2
|
is_use_host=$2
|
||||||
is_use_uuid=$3
|
is_use_uuid=$3
|
||||||
is_use_path=$4
|
is_use_path=$4
|
||||||
is_add_opts="[host] [uuid] [/path]"
|
is_use_remarks=$5
|
||||||
|
is_add_opts="[host] [uuid] [/path] [remarks]"
|
||||||
;;
|
;;
|
||||||
vmess* | tuic*)
|
vmess* | tuic*)
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_uuid=$3
|
is_use_uuid=$3
|
||||||
is_add_opts="[port] [uuid]"
|
is_use_remarks=$4
|
||||||
|
is_add_opts="[port] [uuid] [remarks]"
|
||||||
;;
|
;;
|
||||||
trojan* | hysteria*)
|
trojan* | hysteria*)
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_pass=$3
|
is_use_pass=$3
|
||||||
is_add_opts="[port] [password]"
|
is_use_remarks=$4
|
||||||
|
is_add_opts="[port] [password] [remarks]"
|
||||||
;;
|
;;
|
||||||
*reality*)
|
*reality*)
|
||||||
is_reality=1
|
is_reality=1
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_uuid=$3
|
is_use_uuid=$3
|
||||||
is_use_servername=$4
|
is_use_servername=$4
|
||||||
is_add_opts="[port] [uuid] [sni]"
|
is_use_remarks=$5
|
||||||
|
is_add_opts="[port] [uuid] [sni] [remarks]"
|
||||||
;;
|
;;
|
||||||
shadowsocks)
|
shadowsocks)
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_pass=$3
|
is_use_pass=$3
|
||||||
is_use_method=$4
|
is_use_method=$4
|
||||||
is_add_opts="[port] [password] [method]"
|
is_use_remarks=$5
|
||||||
|
is_add_opts="[port] [password] [method] [remarks]"
|
||||||
;;
|
;;
|
||||||
direct)
|
direct)
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_door_addr=$3
|
is_use_door_addr=$3
|
||||||
is_use_door_port=$4
|
is_use_door_port=$4
|
||||||
is_add_opts="[port] [remote_addr] [remote_port]"
|
is_use_remarks=$5
|
||||||
|
is_add_opts="[port] [remote_addr] [remote_port] [remarks]"
|
||||||
;;
|
;;
|
||||||
anytls*)
|
anytls*)
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_pass=$3
|
is_use_pass=$3
|
||||||
[[ $4 ]] && is_anytls_domain=$4
|
[[ $4 ]] && is_anytls_domain=$4
|
||||||
is_add_opts="[port] [password] [domain]"
|
is_use_remarks=$5
|
||||||
|
is_add_opts="[port] [password] [domain] [remarks]"
|
||||||
;;
|
;;
|
||||||
socks)
|
socks)
|
||||||
is_socks=1
|
is_socks=1
|
||||||
is_use_port=$2
|
is_use_port=$2
|
||||||
is_use_socks_user=$3
|
is_use_socks_user=$3
|
||||||
is_use_socks_pass=$4
|
is_use_socks_pass=$4
|
||||||
is_add_opts="[port] [username] [password]"
|
is_use_remarks=$5
|
||||||
|
is_add_opts="[port] [username] [password] [remarks]"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -1143,7 +1151,7 @@ add() {
|
|||||||
|
|
||||||
# prefer args.
|
# prefer args.
|
||||||
if [[ $2 ]]; then
|
if [[ $2 ]]; then
|
||||||
for v in is_use_port is_use_uuid is_use_host is_use_path is_use_pass is_use_method is_use_door_addr is_use_door_port; do
|
for v in is_use_port is_use_uuid is_use_host is_use_path is_use_pass is_use_method is_use_door_addr is_use_door_port is_use_remarks; do
|
||||||
[[ ${!v} == 'auto' ]] && unset $v
|
[[ ${!v} == 'auto' ]] && unset $v
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -1207,6 +1215,7 @@ add() {
|
|||||||
[[ $is_use_servername ]] && is_servername=$is_use_servername
|
[[ $is_use_servername ]] && is_servername=$is_use_servername
|
||||||
[[ $is_use_socks_user ]] && is_socks_user=$is_use_socks_user
|
[[ $is_use_socks_user ]] && is_socks_user=$is_use_socks_user
|
||||||
[[ $is_use_socks_pass ]] && is_socks_pass=$is_use_socks_pass
|
[[ $is_use_socks_pass ]] && is_socks_pass=$is_use_socks_pass
|
||||||
|
[[ $is_use_remarks ]] && is_remarks=$is_use_remarks
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# anytls with domain (ACME TLS)
|
# anytls with domain (ACME TLS)
|
||||||
|
|||||||
Reference in New Issue
Block a user