qemush/qemu/bin/pathof
2024-01-21 00:28:20 +01:00

20 lines
343 B
Bash
Executable file

#!/bin/sh -e
# Check if QEMUSH_NAME variable is initialized, abort if not
[ -n "$QEMUSH_NAME" ]
# Choose the base dir to print according to argv[1]
case "$1" in
socket)
path="${HOME}/sockets"
;;
disk)
path="${HOME}/disks"
;;
*)
false
;;
esac
# Print the base dir and the name of the VM
printf %s/%s\\n "$path" "$QEMUSH_NAME"