Created
December 30, 2019 04:07
-
-
Save 11808s8/65ab2b5a1afcfbf6b3eb452d5e21e818 to your computer and use it in GitHub Desktop.
Script that searches for the PostgreSQL server running at port 5432, grabs it's PID and kills it's process with the discovered PID.
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 | |
| sudo kill $(sudo ss -lptn 'sport = :5432' | grep -o 'pid=[0-9]\+' | grep -o '[0-9]\+') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment