24 lines
482 B
Bash
24 lines
482 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
if [[ "$(id -u)" -ne "0" ]]
|
||
|
then
|
||
|
echo "you must run $0 as root"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
NAME=openbsd-template
|
||
|
DISK=/var/openkubsd/templates/${NAME}.qcow2
|
||
|
|
||
|
if grep -r "$DISK" /var/openkubsd/vm.conf.d/vms/ | grep -v "/var/openkubsd/vm.conf.d/vms/${NAME}.conf"
|
||
|
then
|
||
|
echo "The configuration files above still need $NAME"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
vmctl stop -fw $NAME
|
||
|
rm "/var/openkubsd/vm.conf.d/vms/${NAME}.conf"
|
||
|
rm "/var/openkubsd/dhcpd.d/${NAME}.conf"
|
||
|
rm "$DISK"
|
||
|
|
||
|
./recreate_conf.sh
|