File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ increase_ip_value() {
8383 if [ -z " $current_usr " ]; then
8484 new_usr=" $USER "
8585 else
86- check_usr=$( echo -e " ${current_usr// ,/ \n } " | grep -w $ USER)
86+ check_usr=$( echo -e " ${current_usr// ,/ \\ n} " | grep -w ^ ${ USER} $ )
8787 if [ -z " $check_usr " ]; then
8888 new_usr=" $current_usr ,$USER "
8989 else
Original file line number Diff line number Diff line change 55# ######################################################################################
66# ###### Place additional commands below. #######
77# ######################################################################################
8+
9+ # Remove duplicate values in U_SYS_USERS variable for ips
10+ for ip in $( ls $HESTIA /data/ips/) ; do
11+ current_usr=$( grep " U_SYS_USERS=" $HESTIA /data/ips/$ip | cut -f 2 -d \' )
12+
13+ new_usr=$( echo $current_usr | sed ' s/,/\n/g' | sort | uniq | paste -sd,)
14+
15+ if [ ! -z $new_usr ]; then
16+ sed -i " s/U_SYS_USERS='$current_usr '/U_SYS_USERS='$new_usr '/g" $HESTIA /data/ips/$ip
17+ fi
18+ done
19+
You can’t perform that action at this time.
0 commit comments