Created
March 28, 2013 09:21
-
-
Save bobisme/5261876 to your computer and use it in GitHub Desktop.
Mac has been acting stupidly since I upgraded to 10.8. My VM has been
crashing when it sleeps and I've been told that skype is always switching
between "online" and "offline". So... Do this instead of just sleeping.
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/sh | |
VM="Ubuntu Server" | |
function wakefunc { | |
VBoxManage startvm $VM | |
osascript -e 'tell application "Skype" to send command "SET USERSTATUS ONLINE" script name "wakescript"' | |
} | |
function sleepfunc { | |
VBoxManage controlvm $VM savestate | |
osascript -e 'tell application "Skype" to send command "SET USERSTATUS OFFLINE" script name "sleepscript"' | |
osascript -e 'tell application "Finder" to sleep' | |
} | |
case "$1" in | |
wake) | |
wakefunc | |
;; | |
sleep) | |
sleepfunc | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment