@@ -762,10 +762,10 @@ syncLibraryLoaded() {
762
762
# find client and server in the roles
763
763
case ,${role^^} ,${name^^} , in
764
764
* ,SERVER,* )
765
- syncHostServerRoleIndex= $i
765
+ syncHostServerRoleIndex+=( $i )
766
766
;;
767
767
* ,CLIENT,* )
768
- syncHostClientRoleIndex= $i
768
+ syncHostClientRoleIndex+=( $i )
769
769
;;
770
770
esac
771
771
@@ -803,21 +803,42 @@ syncLibraryLoaded() {
803
803
done
804
804
805
805
# reset compatibility variables
806
+
806
807
[[ -n " $syncHostServerRoleIndex " ]] && {
807
- export SERVERS=" ${syncHostHostname[$syncHostServerRoleIndex]} "
808
- export syncSERVER=" ${syncHost[$syncHostServerRoleIndex]} "
809
- export syncSERVER_IP=" ${syncHostIP[$syncHostServerRoleIndex]} "
810
- export syncSERVERv6=" ${syncHostIPv6[$syncHostServerRoleIndex]} "
811
- export syncSERVER_IPv6=" ${syncSERVERv6} "
812
- export syncSERVER_HOSTNAME=" ${syncHostHostname[$syncHostServerRoleIndex]} "
808
+ SERVERS=' '
809
+ syncSERVER_HOSTNAME=()
810
+ syncSERVER=()
811
+ syncSERVER_IP=()
812
+ syncSERVERv6=()
813
+ syncSERVER_IPv6=()
814
+ for i in " ${syncHostServerRoleIndex[@]} " ; do
815
+ SERVERS+=" ${syncHostHostname[$i]} "
816
+ syncSERVER_HOSTNAME+=( " ${syncHostHostname[$i]} " )
817
+ syncSERVER+=( " ${syncHost[$i]} " )
818
+ syncSERVER_IP+=( " ${syncHostIP[$i]} " )
819
+ syncSERVERv6+=( " ${syncHostIPv6[$i]} " )
820
+ syncSERVER_IPv6+=( " ${syncHostIPv6[$i]} " )
821
+ done
822
+ SERVERS=" ${SERVERS: 1} "
823
+ export SERVERS syncSERVER syncSERVER_IP syncSERVERv6 syncSERVER_IPv6 syncSERVER_HOSTNAME
813
824
}
814
825
[[ -n " $syncHostClientRoleIndex " ]] && {
815
- export CLIENTS=" ${syncHostHostname[$syncHostClientRoleIndex]} "
816
- export syncCLIENT=" ${syncHost[$syncHostClientRoleIndex]} "
817
- export syncCLIENT_IP=" ${syncHostIP[$syncHostClientRoleIndex]} "
818
- export syncCLIENTv6=" ${syncHostIPv6[$syncHostClientRoleIndex]} "
819
- export syncCLIENT_IPv6=" ${syncCLIENTv6} "
820
- export syncCLIENT_HOSTNAME=" ${syncHostHostname[$syncHostClientRoleIndex]} "
826
+ CLIENTS=' '
827
+ syncCLIENT_HOSTNAME=()
828
+ syncCLIENT=()
829
+ syncCLIENT_IP=()
830
+ syncCLIENTv6=()
831
+ syncCLIENT_IPv6=()
832
+ for i in " ${syncHostClientRoleIndex[@]} " ; do
833
+ CLIENTS+=" ${syncHostHostname[$i]} "
834
+ syncCLIENT_HOSTNAME+=( " ${syncHostHostname[$i]} " )
835
+ syncCLIENT+=( " ${syncHost[$i]} " )
836
+ syncCLIENT_IP+=( " ${syncHostIP[$i]} " )
837
+ syncCLIENTv6+=( " ${syncHostIPv6[$i]} " )
838
+ syncCLIENT_IPv6+=( " ${syncHostIPv6[$i]} " )
839
+ done
840
+ CLIENTS=" ${CLIENTS: 1} "
841
+ export CLIENTS syncCLIENT syncCLIENT_IP syncCLIENTv6 syncCLIENT_IPv6 syncCLIENT_HOSTNAME
821
842
}
822
843
823
844
# get default GW interface
0 commit comments