Created
April 29, 2017 10:19
-
-
Save thewisenerd/90dc46c2cf83a98d275f903583d9a7ab to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
function check_user { | |
if who | grep -v tmux | grep -wq $1; then | |
exit | |
fi | |
} | |
users=( user1 user2 user3 ) | |
for user in ${users[@]} ; do | |
check_user $user | |
done | |
echo "no usrs, shut this down!" | |
gcloud compute instances stop --zone "zone" --quiet "build-machine" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment