2023-04-04 13:29:00 +02:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
2023-08-17 10:51:19 +02:00
|
|
|
set -eu
|
|
|
|
|
2023-04-04 13:29:00 +02:00
|
|
|
# if less than one arguments supplied, display usage
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
|
|
echo "This script takes as input the name of the VM " >&2
|
|
|
|
echo "Usage: $0 vm_name" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-08-18 09:23:14 +02:00
|
|
|
VM_NAME="$1"
|
2023-09-04 13:40:24 +02:00
|
|
|
|
2023-09-04 07:59:43 +02:00
|
|
|
## Make sure VMs can read the base directory:
|
|
|
|
chgrp 1010 "/lmn/media/${SUDO_USER}"
|
2023-09-04 13:40:24 +02:00
|
|
|
chmod 0775 "/lmn/media/${SUDO_USER}"
|
2023-04-04 13:29:00 +02:00
|
|
|
|
2023-09-04 13:20:17 +02:00
|
|
|
systemctl start virtiofs@${VM_NAME}-clone:${SUDO_USER}.service
|