vmstop (332B)
1 #!/bin/sh 2 3 usage() 4 { 5 echo "usage: ${0##*/} [-t tap] name" 1>&2 6 exit 1 7 } 8 9 tap="tap0" 10 11 while getopts "t:" arg; do 12 case "${arg}" in 13 t) tap="${OPTARG}" ;; 14 *) usage ;; 15 esac 16 done 17 shift $((OPTIND - 1)) 18 19 name="${1}" 20 test -z "${name}" && usage 21 22 ifconfig ${tap} down 23 bhyvectl --force-poweroff --vm=${name} 24 bhyvectl --destroy --vm=${name}