fix: fix scripts and optimize

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-08-08 22:44:15 +08:00
parent da1316af2a
commit be6f189365
18 changed files with 131 additions and 61 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ service_port_name=(
for i in ${service_port_name[*]}; do
list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}')
list_to_string $list
openim::util:list-to-string $list
for j in ${ports_array}; do
port=$(ss -tunlp| grep openim | awk '{print $5}' | grep -w ${j} | awk -F '[:]' '{print $NF}')
if [[ ${port} -ne ${j} ]]; then
+2 -2
View File
@@ -15,7 +15,7 @@
#input:[10023,2323,3434]
#output:10023 2323 3434
list_to_string(){
openim::util:list-to-string(){
ports_list=$*
sub_s1=`echo $ports_list | sed 's/ //g'`
sub_s2=${sub_s1//,/ }
@@ -23,7 +23,7 @@ list_to_string(){
sub_s4=${sub_s3%]*}
ports_array=$sub_s4
}
remove_space(){
openim::util::remove_space(){
value=$*
result=`echo $value | sed 's/ //g'`
}