Use a for loop to detect if System.map exists

This commit is contained in:
madaidan 2019-06-26 12:59:45 +00:00 committed by GitHub
parent 3116a56f13
commit 8ef0db17e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,9 @@
#!/bin/bash
# Removes the System.map files as they are only used for debugging or malware.
if [ -f /boot/System.map-* ]; then
rm /boot/System.map-*
fi
for file in /boot/System.map-*
do
if [ -f "${file}" ]; then
rm "${file}"
fi
done