Last active
March 7, 2020 04:53
-
-
Save hoangdh/924beae83205020a5b5f3e610bbcbf12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
users=`cat /tmp/malware.detect | grep "tmp" | awk -F '/' {'print $3'}` | |
if [ -n "$users" ] | |
then | |
for x in $users | |
do | |
pid=`pgrep -u $x` | |
if [ -n "$pid" ] | |
then | |
kill -9 $pid | |
echo "$x : Killed proccess: $pid." | |
else | |
echo "$x : No proccess." | |
fi | |
file=`cat /tmp/malware.detect | grep $x | cut -d "|" -f1` | |
if [ -e $file ] | |
then | |
rm -rf $file | |
echo "$x: Removed: $file." | |
else | |
echo "$x : No file." | |
fi | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment