Last active
December 27, 2015 18:39
-
-
Save wearethefoos/7371095 to your computer and use it in GitHub Desktop.
Check with bash whether your Resque workers run from the current release folder.
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
releases=`ps aux | grep resque- | sudo pwdx \`awk '{print $2}'\` | sed 's/\(.*\)\/path\/to\/releases\/\(.*\)/\2/' | sed 's/.*No such process//'` | |
current_release=`readlink /path/to/current | sed 's/\/path\/to\/releases\/\(.*\)/\1/'` | |
for r in $releases; do | |
if [ $r = $current_release ]; then | |
echo 'yes' | |
else | |
echo 'no' | |
fi | |
done |
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
for r in `ps aux | grep resque- | sudo pwdx \`awk '{print $2}'\` | sed 's/\(.*\)\/path\/to\/releases\/\(.*\)/\2/' | sed 's/.*No such process//'`; do if [ `readlink /path/to/current | sed 's/\/path\/to\/releases\/\(.*\)/\1/'` = $r ]; then echo 'yes'; else echo 'no'; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment