Last active
March 16, 2021 12:42
-
-
Save Nex-Otaku/05148755308f6d47138c63731567667e to your computer and use it in GitHub Desktop.
Bash script to stop Yii server
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 | |
YII_SERVER_PGID=$(ps x -o pgid,command | grep -v grep | grep "/vendor/bin/yii serve" | awk '{print $1;}') | |
if [[ -z "$YII_SERVER_PGID" ]]; then | |
echo "Yii server not running." | |
else | |
kill -TERM -- -$YII_SERVER_PGID | |
echo "Killed Yii server." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment