Last active
August 29, 2015 14:21
-
-
Save pringlized/92475251cf1be5f749c8 to your computer and use it in GitHub Desktop.
Start or Gracefully restart Cities Skylines while coding and compiling a mod
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 | |
# Check if the CSL app is running | |
pid=$(ps -ax | grep -m1 'Cities_Skylines/Cities.app' | grep -v grep | awk '{print $1}') | |
if [[ $pid ]] | |
then | |
echo "Cities is running under pid: $pid" | |
echo "Quitting Cities.." | |
osascript -e 'quit app "Cities"' | |
sleep 4 | |
# CSL was being stubborn on occasion. Not quitting as asked. No more nice guy. | |
pid=$(ps -ax | grep -m1 'Cities_Skylines/Cities.app' | grep -v grep | awk '{print $1}') | |
if [[ $pid ]] | |
then | |
echo "Cites won't quit. Killing process #$pid.." | |
kill $pid | |
sleep 2 | |
fi | |
fi | |
echo "Starting Cities.." | |
open ~/Applications/Cities\ Skylines.app/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment