Sorry if the question is duplicated, it's that I'm new here and I'm learning to use this system.
I have the command below that saves in a log an ip that hit with the varialvel string.
I wanted that after saving this ip in the log file would run the squid reconfiguration command, the "squid -k reconfigure" to reconfigure the squid and release the access based on that ip captured and thrown in the log.
Can someone help me?
#!/bin/sh
TAIL="/usr/bin/tail -f"
SQUID="/var/log/squid/access.log"
SQUID2="/usr/sbin/squid -k reconfigure"
PRINCIPAL2="http://cartilha.cert.br/"
LOG="/var/corples/pagina-inicial/autenticados.txt"
$TAIL $SQUID | gawk -v var2=$PRINCIPAL2 '{if ($7 == var2) {print $3} fflush()}' >> $LOG