Contrôle caractère dans fichier
Bonjour,
j'ai un fichier contenant une configuration répéter plusieurs fois :
backend mybackend
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers
stick on src
et je voudrais un script bash pour m'assurer qu'il ne manque jamais d'option, j'essai avec une boucle for mais je n'y arrive pas du tout, avez vous une idée svp?
contrôle caractere fichier
Hello,
En fait dans mon fichier, il arrive parfois qu'une option sois manquante ou est en double
c'est un fichier renseigner automatiquement par un orchestrator qui parfois bug..
par exemple ce matin dans mon fichier j'avais deux fois une ligne avec une adresse IP.
je voudrais m'assurrer qu'il y est toujours le meme nombre de param a chaque ajout de config
ça ressemble a ça :
backend AAA
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers
server srv1 192.168.0.30:80
backend BBB
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers
server srv1 192.168.0.30:80
backend CCC
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers
server srv1 192.168.0.30:80
backend DDD
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers
server srv1 192.168.0.30:80
et je voudrais eviter de me rerotuver avec un truc du genre :
backend AAA
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers
server srv1 192.168.0.30:80
server srv1 192.128.0.30:80
MAIS AUSSI SANS AVEC DES OPTIONS MANQUANTES COMME CI DESSOUS LES SERVEUR
backend AAA
mode tcp
balance roundrobin
stick-table type ip size 20k peers mypeers