Skip to content

Instantly share code, notes, and snippets.

@indefinit
Created May 4, 2015 12:29
Show Gist options
  • Save indefinit/0f207a0bbea5a6596a57 to your computer and use it in GitHub Desktop.
Save indefinit/0f207a0bbea5a6596a57 to your computer and use it in GitHub Desktop.
A small suite of simple bash scripts for use in long term installations (monitoring/maintenance, etc.)
#!/bin/sh
echo "shutting down [your app name] for the day" >> /Users/SI/Dropbox/InstallationLogs/[your app name here]/ProcessLog.txt
osascript -e 'tell application "[your app name]" to quit'
echo "successful shutdown at $(date)" >> /Users/SI/Dropbox/InstallationLogs/[your app name here]/ProcessLog.txt
#!/bin/sh
# begin code block
{
if [ -z $(ps aux | grep '[replace with your app name here]') ]
then
echo "App not running."
else
echo $(ps aux | grep 'replace with your app name')
fi
} >> /Users/SI/Dropbox/InstallationLogs/[your app name here]/ProcessLog.txt
system_profiler SPDisplaysDataType | grep Resolution >> /Users/SI/Dropbox/InstallationLogs/[your app name]/DisplayResolutionLog.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment