Skip to content

Commit

Permalink
added onlyfiles additional script
Browse files Browse the repository at this point in the history
  • Loading branch information
wireghoul committed Apr 9, 2021
1 parent f8aab44 commit 82911bb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions misc/onlyfiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Scan only specific file types
# usage: ./onlyfiles.sh <db> <files> <location>
# example: ./onlyfiles.sh js *.js,*.ts,*.php /some/dir
OIFS=$IFS
IFS=','
filter="-type f ( "
for inc in $2; do
if [ -z $incfiles ]; then
incfiles="-name $inc"
else
incfiles="$incfiles -o -name $inc"
fi
done
filter="$filter $incfiles )"
IFS=$OIFS
find "$3" $filter -exec graudit -d "$1" -B {} \;

0 comments on commit 82911bb

Please sign in to comment.