@@ -918,6 +918,7 @@ add() {
918
918
is_use_host=$2
919
919
is_use_uuid=$3
920
920
is_use_path=$4
921
+ is_add_opts=" [host] [uuid] [/path]"
921
922
;;
922
923
vmess* )
923
924
is_use_port=$2
@@ -926,6 +927,11 @@ add() {
926
927
is_use_dynamic_port_start=$5
927
928
is_use_dynamic_port_end=$6
928
929
[[ $( grep dynamic-port <<< $is_new_protocol ) ]] && is_dynamic_port=1
930
+ if [[ $is_dynamic_port ]]; then
931
+ is_add_opts=" [port] [uuid] [type] [start_port] [end_port]"
932
+ else
933
+ is_add_opts=" [port] [uuid] [type]"
934
+ fi
929
935
;;
930
936
# *reality*)
931
937
# is_reality=1
@@ -937,24 +943,32 @@ add() {
937
943
is_use_port=$2
938
944
is_use_pass=$3
939
945
is_use_method=$4
946
+ is_add_opts=" [port] [password] [method]"
940
947
;;
941
948
* door)
942
949
is_use_port=$2
943
950
is_use_door_addr=$3
944
951
is_use_door_port=$4
952
+ is_add_opts=" [port] [remote_addr] [remote_port]"
945
953
;;
946
954
socks)
947
955
is_socks=1
948
956
is_use_port=$2
949
957
is_use_socks_user=$3
950
958
is_use_socks_pass=$4
959
+ is_add_opts=" [port] [username] [password]"
951
960
;;
952
961
* http)
953
962
is_use_port=$2
963
+ is_add_opts=" [port]"
954
964
;;
955
965
esac
956
966
957
- [[ $1 && ! $is_change ]] && msg " \n使用协议: $is_new_protocol "
967
+ [[ $1 && ! $is_change ]] && {
968
+ msg " \n使用协议: $is_new_protocol "
969
+ # err msg tips
970
+ is_err_tips=" \n\n请使用: $( _green $is_core add $1 $is_add_opts ) 来添加 $is_new_protocol 配置"
971
+ }
958
972
959
973
# remove old protocol args
960
974
if [[ $is_set_new_protocol ]]; then
@@ -1003,28 +1017,28 @@ add() {
1003
1017
1004
1018
if [[ $is_use_port ]]; then
1005
1019
[[ ! $( is_test port ${is_use_port} ) ]] && {
1006
- err " ($is_use_port ) 不是一个有效的端口."
1020
+ err " ($is_use_port ) 不是一个有效的端口. $is_err_tips "
1007
1021
}
1008
1022
[[ $( is_test port_used $is_use_port ) ]] && {
1009
- err " 无法使用 ($is_use_port ) 端口."
1023
+ err " 无法使用 ($is_use_port ) 端口. $is_err_tips "
1010
1024
}
1011
1025
port=$is_use_port
1012
1026
fi
1013
1027
if [[ $is_use_door_port ]]; then
1014
1028
[[ ! $( is_test port ${is_use_door_port} ) ]] && {
1015
- err " (${is_use_door_port} ) 不是一个有效的目标端口."
1029
+ err " (${is_use_door_port} ) 不是一个有效的目标端口. $is_err_tips "
1016
1030
}
1017
1031
door_port=$is_use_door_port
1018
1032
fi
1019
1033
if [[ $is_use_uuid ]]; then
1020
1034
[[ ! $( is_test uuid $is_use_uuid ) ]] && {
1021
- err " ($is_use_uuid ) 不是一个有效的 UUID."
1035
+ err " ($is_use_uuid ) 不是一个有效的 UUID. $is_err_tips "
1022
1036
}
1023
1037
uuid=$is_use_uuid
1024
1038
fi
1025
1039
if [[ $is_use_path ]]; then
1026
1040
[[ ! $( is_test path $is_use_path ) ]] && {
1027
- err " ($is_use_path ) 不是有效的路径."
1041
+ err " ($is_use_path ) 不是有效的路径. $is_err_tips "
1028
1042
}
1029
1043
path=$is_use_path
1030
1044
fi
@@ -1044,7 +1058,7 @@ add() {
1044
1058
for v in ${is_tmp_list[@]} ; do
1045
1059
msg " \t\t$v "
1046
1060
done
1047
- msg
1061
+ msg " $is_err_tips \n "
1048
1062
exit 1
1049
1063
}
1050
1064
ss_method=$is_tmp_use_type
0 commit comments