Created
April 12, 2023 16:38
-
-
Save piotrmaslanka/afcb490fae4bf2f98394378eb4b50377 to your computer and use it in GitHub Desktop.
antivir-psql.sh
This file contains 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 | |
# | |
# After noticing a bunch of weird psql processes running on my server I decided all of them needed to die. | |
# This is what this script is for. | |
# Just put the following line (without the "# " at the beginning) into your crontab, this process in /usr/bin/antivir-psql.sh. | |
# and make it executable only for the owner (readable for the owner as well). If you want to disable the conditional disable, just remove | |
# the lines starting with if and fi. If you want to disable the antivirus for some time, just drop a /antivir-disabled file. Remember | |
# to edit it out when you're gone. And there goes the fabulous crontab line: | |
# | |
# * * * * * root /usr/bin/antivir-psql.sh | |
if [ ! -a "/antivir-disabled" ]; then | |
kill -9 `ps aux | grep psql | cut -d" " -f 6` ; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment