Skip to content

Instantly share code, notes, and snippets.

@pringlized
Last active August 29, 2015 14:21
Show Gist options
  • Save pringlized/92475251cf1be5f749c8 to your computer and use it in GitHub Desktop.
Save pringlized/92475251cf1be5f749c8 to your computer and use it in GitHub Desktop.
Start or Gracefully restart Cities Skylines while coding and compiling a mod
#!/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