You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
995 B
30 lines
995 B
#!/bin/bash
|
|
|
|
# Directories to search for executables
|
|
DIRS=("/usr/bin" "/usr/sbin" "/usr/local/bin")
|
|
|
|
# Process each directory
|
|
for dir in "${DIRS[@]}"; do
|
|
# Check if directory exists
|
|
if [[ -d "$dir" ]]; then
|
|
echo "Processing directory: $dir"
|
|
|
|
# Find all executable files in the directory
|
|
find "$dir" -maxdepth 1 -type f -executable | while read -r program; do
|
|
# Get just the program name without path: prog_name=$(basename "$program")
|
|
# Run execguard --update on the program
|
|
echo "Updating execguard for: $program"
|
|
sudo execguard --update "$program"
|
|
done
|
|
else
|
|
echo "Directory not found: $dir" >&2
|
|
fi
|
|
done
|
|
|
|
# custom files here:
|
|
sudo execguard --update /usr/bin/mail
|
|
if [ -x /usr/local/maldetect/maldet ]; then
|
|
sudo execguard --update /usr/local/maldetect/maldet
|
|
fi
|
|
sudo execguard --update /usr/lib/update-notifier/package-data-downloader
|
|
echo "Finished processing all directories"
|
|
|