mardi 8 décembre 2020

BASH VARIABLE ADEED AFTER SQLITE3 LIKE CLAUSE

I have a question about an sqlite3 command that im trying to insert inside my script

if [[ -n $(tail -z 600 /var/log/pihole.log | grep "$IP" | wc -c) ]];then

sudo -u pihole sqlite3 /etc/pihole/pihole-FTL.db 'DELETE FROM network WHERE hwaddr LIKE "$MAC"'

fi

But soon i run my program it actually doesn't do what it was made for !

I already try whit a real mac address instead of the variable $MAC and it works !

So my question is how can i actually attach a variable in this particular bash command and of my script !

Thank-you in advance really appreciated !

Aucun commentaire:

Enregistrer un commentaire