23 lines
409 B
Bash
Executable File
23 lines
409 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [[ "$(id -u)" -ne "0" ]]
|
|
then
|
|
echo "you must run $0 as root"
|
|
exit 1
|
|
fi
|
|
|
|
NAME=${1:-kube}
|
|
|
|
if vmctl status $NAME | grep running >/dev/null
|
|
then
|
|
exit 0
|
|
fi
|
|
|
|
set -x
|
|
|
|
# create a derived disk from the template
|
|
arp -d $NAME.kube
|
|
rm -f /var/openkubsd/derived/${NAME}.qcow2
|
|
vmctl create -b /var/openkubsd/templates/openbsd-template.qcow2 /var/openkubsd/derived/${NAME}.qcow2
|
|
vmctl start $NAME
|