trixie/roles/lmn_vm/files/start-virtiofsd.sh

19 lines
412 B
Bash
Raw Normal View History

#!/usr/bin/bash
set -eu
# 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
VM_NAME="$1"
2023-09-04 13:40:24 +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-09-04 13:20:17 +02:00
systemctl start virtiofs@${VM_NAME}-clone:${SUDO_USER}.service