qemush/qemu/bin/pathof

21 lines
337 B
Text
Raw Normal View History

#!/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=/run/qemush
;;
disk)
path="${HOME}/disks"
;;
*)
false
;;
esac
# Print the base dir and the name of the VM
printf %s/%s\\n "$path" "$QEMUSH_NAME"