Last active
June 23, 2022 21:45
-
-
Save heywoodlh/42abd3358288cb881a86d980751d82c0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
if limactl list | grep -q docker | |
then | |
echo 'lima docker vm exists' | |
else | |
echo 'lima docker vm does not exist -- creating now' | |
limactl start --name=docker template://docker --tty=false | |
fi | |
while read line | |
do | |
if echo ${line} | grep -q Running | |
then | |
echo 'Lima already running' | |
else | |
limactl stop -f docker | |
limactl start docker | |
fi | |
done < <(while true; do limactl list | grep docker ; sleep 2; done) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment