File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ json_list_user_ips() {
2323 echo ' {'
2424
2525 owned_ips=$( grep -l " OWNER='$user '" $V_IPS /* )
26- shared_ips=$( grep -A5 " OWNER='vesta'" $V_IPS /* | \
26+ shared_ips=$( grep -H - A5 " OWNER='vesta'" $V_IPS /* | \
2727 grep " STATUS='shared'" | \
2828 cut -f 1 -d - )
2929
30- ip_list=" $owned_ips $shared_ips "
30+ ip_list=" $owned_ips \n $shared_ips "
3131 fileds_count=$( echo " $fields " | wc -w)
3232
3333 # Starting main loop
34- for IP in $ip_list ; do
34+ for IP in $( echo -e " $ ip_list" | sort -u ) ; do
3535 IP=$( basename $IP )
3636 ip_data=$( cat $V_IPS /$IP )
3737
@@ -75,11 +75,11 @@ json_list_user_ips() {
7575# Shell function
7676shell_list_user_ips () {
7777 owned_ips=$( grep -l " OWNER='$user '" $V_IPS /* )
78- shared_ips=$( grep -A5 " OWNER='vesta'" $V_IPS /* | \
78+ shared_ips=$( grep -H - A5 " OWNER='vesta'" $V_IPS /* | \
7979 grep " STATUS='shared'" | \
8080 cut -f 1 -d - )
8181
82- ip_list=" $owned_ips $shared_ips "
82+ ip_list=" $owned_ips \n $shared_ips "
8383 if [ -z " $nohead " ]; then
8484 # Print brief info
8585 echo " ${fields// $/ } "
@@ -90,7 +90,7 @@ shell_list_user_ips() {
9090 fi
9191
9292 # Starting main loop
93- for IP in $ip_list ; do
93+ for IP in $( echo -e " $ ip_list" | sort -u ) ; do
9494 IP=$( basename $IP )
9595 ip_data=$( cat $V_IPS /$IP )
9696
You can’t perform that action at this time.
0 commit comments