20 lines
337 B
Bash
Executable file
20 lines
337 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=/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"
|