Last active
August 18, 2023 14:26
-
-
Save chrissearle/b8434a11eaabd76bcf8a8e74dde21f61 to your computer and use it in GitHub Desktop.
Colima mac - auto-start
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 | |
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
function shutdown() { | |
colima stop | |
exit 0 | |
} | |
trap shutdown SIGTERM | |
trap shutdown SIGKILL | |
trap shutdown SIGINT | |
# wait until colima is running | |
while true; do | |
colima status &>/dev/null | |
if [[ \$? -eq 0 ]]; then | |
break; | |
fi | |
colima start | |
sleep 5 | |
done | |
tail -f /dev/null & | |
wait \$! |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.github.abiosoft.colima</string> | |
<key>Program</key> | |
<string>/opt/local/bin/colima-start</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<false/> | |
</dict> | |
</plist> |
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
alias colimaStop="launchctl unload -w $HOME/Library/LaunchAgents/com.github.abiosoft.colima.plist" | |
alias colimaStart="launchctl load -w $HOME/Library/LaunchAgents/com.github.abiosoft.colima.plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mac 13.5.1 seemed to have issues - found this bug:
abiosoft/colima#746
TL;DR:
brew reinstall -f --force-bottle qemu