Created
April 4, 2024 17:53
-
-
Save drazulay/262ffdb61e0c87862c391470b1eda752 to your computer and use it in GitHub Desktop.
Kill all PHP-FPM instances running
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
killphp () { | |
printf "This will kill all PHP-FPM instances running. Continue (y/N)? " | |
read -q | |
if [[ $? -eq 0 ]] | |
then | |
for pid in $(ps aux | grep php-fpm | grep -v color | tr -s " " | cut -d" " -f2) | |
do | |
sudo kill -9 $pid | |
done | |
echo "\nall instances killed" | |
else | |
echo "\ncancelled" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment