Compare commits

...

3 Commits

4 changed files with 41 additions and 5 deletions

@ -1 +1 @@
Subproject commit 8825fc5980678050edde42e7555a15e3ed99c016
Subproject commit 94de4f0a8e855543c0f1b0679aebf7caa2db56c9

@ -1 +1 @@
Subproject commit 62f717eda520af256b05f20505f18eca0d22e7b6
Subproject commit 70a9255d1e6732bd3f43f633b32dfb20fea66aba

View File

@ -192,6 +192,11 @@ elif [ "$1" == "up" ]; then
else
echo "usage: mocha suv up MACHINENAME"
fi
elif [ "$1" == "show" ]; then
URL="https://$2.privatesuv.com"
xdg-open "$URL"
elif [ "$1" == "down" ]; then
@ -209,7 +214,36 @@ elif [ "$1" == "down" ]; then
else
VBoxManage controlvm "mochasuv-$2" poweroff &
EXISTS=$(VBoxManage list vms | grep 'mochasuv-$2')
if [ "$EXISTS" != "" ]; then
# is VBox VM
VBoxManage controlvm "mochasuv-$2" poweroff &
else
EXISTS=$(echo "$LXC_VMS" | grep $2)
if [ "$EXISTS" != "" ]; then
# LXC container found, start it
lxc stop $2
else
# last chance, maybe we used Docker
EXISTS=$(echo "$DOCKER_VMS_RUNNING" | grep $2)
if [ "$EXISTS" != "" ]; then
docker container stop $2
else
exit 127
fi
fi
fi
fi
@ -292,9 +326,11 @@ elif [ "$1" == "new" ]; then
shift;
BACKEND="docker"
UNATTENDED="0"
while true; do
case "$1" in
--unattended ) UNATTENDED="1"; shift ;;
-b | --backend ) BACKEND="$2"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;

View File

@ -20,10 +20,10 @@ _mocha()
return 0
;;
suv)
COMPREPLY=( $( compgen -W "new up down delete shell status list" -- "$cur" ) )
COMPREPLY=( $( compgen -W "new up down show delete shell status list" -- "$cur" ) )
return 0
;;
up|down|delete|shell|status)
up|down|show|delete|shell|status)
COMPREPLY=( $( compgen -W "$(mocha suv list)" -- "$cur" ) )
return 0
;;