2018-05-03 12:39:14 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# qvm-copy-to-dom0
|
|
|
|
# Copy a file from an AppVM to dom0
|
|
|
|
# script has to be run in dom0
|
|
|
|
# qvm-copy-to-dom0 <AppVM> <Source in AppVM> <Destination in dom0>
|
|
|
|
# Initial author: https://github.com/one7two99/
|
|
|
|
|
|
|
|
# command line parameters
|
2021-05-30 08:37:03 -04:00
|
|
|
AppVM="$1" # must be present
|
|
|
|
Source="$2" # must be present
|
|
|
|
Destination="$3" # optionally
|
2018-05-03 12:39:14 -04:00
|
|
|
|
|
|
|
# if no Destination given on commandline use ~/QubesIncoming
|
2021-05-30 08:37:03 -04:00
|
|
|
if [ -z "$Destination" ];then mkdir -p -- "~/QubesIncoming" && \
|
|
|
|
Destination="~/QubesIncoming/$(basename "$Source")"; fi
|
2018-05-03 12:39:14 -04:00
|
|
|
|
|
|
|
# copy file from AppVM to dom0
|
2021-05-30 08:37:03 -04:00
|
|
|
qvm-run --pass-io $AppVM "cat -- \"$Source\"" > "$Destination"
|