mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-07-13 17:29:47 +07:00
36 lines
948 B
Bash
Executable File
36 lines
948 B
Bash
Executable File
#!/bin/bash
|
|
|
|
## Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP <adrelanos@riseup.net>
|
|
## See the file COPYING for copying conditions.
|
|
|
|
if [ -f /usr/lib/helper-scripts/pre.bsh ]; then
|
|
## pre.bsh would `source` the following folders:
|
|
## /etc/remove-system.map_pre.d/*.conf
|
|
## /usr/local/etc/remove-system.map_pre.d/*.conf
|
|
source /usr/lib/helper-scripts/pre.bsh
|
|
fi
|
|
|
|
shopt -s nullglob
|
|
|
|
system_map_location="/boot/System.map* /usr/src/*/System.map* /lib/modules/*/*/System.map* /System.map*"
|
|
|
|
counter=0
|
|
for filename in ${system_map_location} ; do
|
|
counter=$(( counter + 1 ))
|
|
done
|
|
|
|
if [ "$counter" -ge "1" ]; then
|
|
echo "Deleting system.map files..."
|
|
fi
|
|
|
|
## Removes the System.map files as they are only used for debugging or malware.
|
|
for filename in ${system_map_location} ; do
|
|
if [ -f "${filename}" ]; then
|
|
shred --verbose --force --zero -u "${filename}"
|
|
fi
|
|
done
|
|
|
|
if [ "$counter" -ge "1" ]; then
|
|
echo "Done. Success."
|
|
fi
|