|
|
@ -448,11 +448,14 @@ creeMV()
|
|
|
|
genCmdIntRzo(){
|
|
|
|
genCmdIntRzo(){
|
|
|
|
# Création d'une interface non étiqueté (access)
|
|
|
|
# Création d'une interface non étiqueté (access)
|
|
|
|
if [[ "${pont_init}" -eq 1 && "${vlan_init}" -eq 1 && "${interface_init}" -eq 1 ]]; then
|
|
|
|
if [[ "${pont_init}" -eq 1 && "${vlan_init}" -eq 1 && "${interface_init}" -eq 1 ]]; then
|
|
|
|
commandes_a_executer+=( "ip tuntap add ${interface} mode tap" )
|
|
|
|
# Commandes à executer au demarrage
|
|
|
|
commandes_a_executer+=( "ip link set ${interface} up" )
|
|
|
|
commandes_a_executer_on+=( "ip tuntap add ${interface} mode tap" )
|
|
|
|
commandes_a_executer+=( "ip link set ${interface} master ${pont}" )
|
|
|
|
commandes_a_executer_on+=( "ip link set ${interface} up" )
|
|
|
|
commandes_a_executer+=( "bridge vlan del dev ${interface} vid 1 PVID untagged master" )
|
|
|
|
commandes_a_executer_on+=( "ip link set ${interface} master ${pont}" )
|
|
|
|
commandes_a_executer+=( "bridge vlan add dev ${interface} vid ${vlan} pvid untagged master" )
|
|
|
|
commandes_a_executer_on+=( "bridge vlan del dev ${interface} vid 1 PVID untagged master" )
|
|
|
|
|
|
|
|
commandes_a_executer_on+=( "bridge vlan add dev ${interface} vid ${vlan} pvid untagged master" )
|
|
|
|
|
|
|
|
# Commandes à exectuer à l'arrêt
|
|
|
|
|
|
|
|
commandes_a_executer_off+=( "ip link del ${interface}" )
|
|
|
|
|
|
|
|
|
|
|
|
# Réinitialisation des variables témoins
|
|
|
|
# Réinitialisation des variables témoins
|
|
|
|
pont_init=0
|
|
|
|
pont_init=0
|
|
|
@ -461,13 +464,15 @@ genCmdIntRzo(){
|
|
|
|
|
|
|
|
|
|
|
|
# Création d'une interface étiqueté (trunk)
|
|
|
|
# Création d'une interface étiqueté (trunk)
|
|
|
|
elif [[ "${pont_init}" -eq 1 && "${ieee8021q_init}" -eq 1 && "${interface_init}" -eq 1 ]]; then
|
|
|
|
elif [[ "${pont_init}" -eq 1 && "${ieee8021q_init}" -eq 1 && "${interface_init}" -eq 1 ]]; then
|
|
|
|
commandes_a_executer+=( "ip tuntap add ${interface} mode tap" )
|
|
|
|
commandes_a_executer_on+=( "ip tuntap add ${interface} mode tap" )
|
|
|
|
commandes_a_executer+=( "ip link set ${interface} up" )
|
|
|
|
commandes_a_executer_on+=( "ip link set ${interface} up" )
|
|
|
|
commandes_a_executer+=( "ip link set ${interface} master ${pont}" )
|
|
|
|
commandes_a_executer_on+=( "ip link set ${interface} master ${pont}" )
|
|
|
|
commandes_a_executer+=( "bridge vlan del dev ${interface} vid 1 PVID untagged master" )
|
|
|
|
commandes_a_executer_on+=( "bridge vlan del dev ${interface} vid 1 PVID untagged master" )
|
|
|
|
for ((id_label_vlan=0 ; "${nb_params_label}" - "${id_label_vlan}" ; id_label_vlan++)); do
|
|
|
|
for ((id_label_vlan=0 ; "${nb_params_label}" - "${id_label_vlan}" ; id_label_vlan++)); do
|
|
|
|
commandes_a_executer+=( "bridge vlan add dev ${interface} vid ${label_vlan[${id_label_vlan}]} tagged master" )
|
|
|
|
commandes_a_executer_on+=( "bridge vlan add dev ${interface} vid ${label_vlan[${id_label_vlan}]} tagged master" )
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
# Commandes à exectuer à l'arrêt
|
|
|
|
|
|
|
|
commandes_a_executer_off+=( "ip link del ${interface}" )
|
|
|
|
|
|
|
|
|
|
|
|
# Réinitialisation des variables témoins
|
|
|
|
# Réinitialisation des variables témoins
|
|
|
|
pont_init=0
|
|
|
|
pont_init=0
|
|
|
@ -475,7 +480,7 @@ genCmdIntRzo(){
|
|
|
|
interface_init=0
|
|
|
|
interface_init=0
|
|
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "commandes_a_executer=${commandes_a_executer[@]}" # Debogage
|
|
|
|
echo "commandes_a_executer_on=${commandes_a_executer_on[@]}" # Debogage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Fonction exécuté en premier. Récupère les paramètres du fichier de configuration du conteneur
|
|
|
|
# Fonction exécuté en premier. Récupère les paramètres du fichier de configuration du conteneur
|
|
|
@ -641,11 +646,12 @@ case ${1} in
|
|
|
|
echo 1 "$#" # Debogage
|
|
|
|
echo 1 "$#" # Debogage
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
echo "Demarrage de la MV..." # Debogage
|
|
|
|
echo "Demarrage de la MV..." # Debogage
|
|
|
|
#recupParams
|
|
|
|
recupParams
|
|
|
|
#execCmd "${commandes_a_executer[@]}"
|
|
|
|
execCmd "${commandes_a_executer_on[@]}"
|
|
|
|
commande_qemu=$(grep -Ev '^#|^$' ${chemin_mv} | tr -d '\n' | tr -d '\\')
|
|
|
|
commande_qemu=$(grep -Ev '^#|^$' ${chemin_mv} | tr -d '\n' | tr -d '\\')
|
|
|
|
echo "${bin_qemu} ${commande_qemu}" # Debogage
|
|
|
|
echo "${bin_qemu} ${commande_qemu}" # Debogage
|
|
|
|
${bin_qemu} ${commande_qemu}
|
|
|
|
${bin_qemu} ${commande_qemu}
|
|
|
|
|
|
|
|
execCmd "${commandes_a_executer_off[@]}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
|
|
case "${1}" in
|
|
|
|
case "${1}" in
|
|
|
|