From 1b7d56627dd0b22e26bf417849895b808d321fe8 Mon Sep 17 00:00:00 2001 From: Breizh Date: Wed, 3 Jan 2018 19:30:10 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20taille=20dans=20les=20=C3=A9l?= =?UTF-8?q?=C3=A9ments=20=C3=A0=20v=C3=A9rifier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.sh b/init.sh index dfc0501..9b52610 100755 --- a/init.sh +++ b/init.sh @@ -26,7 +26,8 @@ set -e # On lance les commandes sqlite sqlite3 suidchecker.db \ - "CREATE TABLE fichier(chemin TEXT PRIMARY KEY, checksum INTEGER);" + "CREATE TABLE fichier(chemin TEXT PRIMARY KEY, checksum INTEGER, taille + INTEGER);" sqlite3 suidchecker.db "CREATE TABLE controle( chemin TEXT, date INTEGER, @@ -50,8 +51,10 @@ for f in $files do # On récupère son checksum checksum=$(cksum $f | cut -d' ' -f 1) + taille=$(cksum $f | cut -d' ' -f 2) # Et on insère le couple chemin, checksum dans la base - sqlite3 suidchecker.db "INSERT INTO fichier VALUES('$f', $checksum);" + sqlite3 suidchecker.db "INSERT INTO fichier VALUES('$f', $checksum, + $taille);" done