From 8ef0db17e6a9c066b50a021292aab80a7523cbb6 Mon Sep 17 00:00:00 2001 From: madaidan <50278627+madaidan@users.noreply.github.com> Date: Wed, 26 Jun 2019 12:59:45 +0000 Subject: [PATCH] Use a for loop to detect if System.map exists --- usr/lib/security-misc/remove-system.map | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr/lib/security-misc/remove-system.map b/usr/lib/security-misc/remove-system.map index 75edbbe..8e723f9 100644 --- a/usr/lib/security-misc/remove-system.map +++ b/usr/lib/security-misc/remove-system.map @@ -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