Last active
December 27, 2019 07:34
-
-
Save nemasu/9d89d2998822980a07284bf442342482 to your computer and use it in GitHub Desktop.
Progress for clamdscan.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
function show_progress() { | |
echo -ne "\r" | |
echo -n "`echo "scale=5; ($count / $total)*100" | bc`" | |
} | |
path="/" | |
if [ -n "$1" ]; then | |
path="$1" | |
fi | |
IFS=$'\n' | |
echo > /tmp/vs.log | |
let total=`find "$path" -mindepth 1 -not -path "/proc*" -not -path "/dev*" -not -path "/sys*" -type d | wc -l` | |
let count=0 | |
for d in `find "$path" -mindepth 1 -not -path "/proc*" -not -path "/dev*" -not -path "/sys*" -type d 2>/dev/null`; do | |
let count=${count}+1 | |
show_progress | |
echo "$d" >> /tmp/vs.log | |
for f in `find "$d" -mindepth 1 -maxdepth 1 -type f 2>/dev/null`; do | |
clamdscan --quiet "$f" | |
done | |
done; | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment