Merge remote-tracking branch 'qubesos/pr/5'

* qubesos/pr/5:
  Use #!/bin/bash and && in qvm-move-to-vm
  qvm-copy-to-vm: Fix running with multiple file arguments
  qvm-move-to-vm: Remove duplicated code
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-23 03:53:27 +01:00
commit 199d12636b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/bash
set -e -o pipefail
# #
# The Qubes OS Project, http://www.qubes-os.org # The Qubes OS Project, http://www.qubes-os.org
# #
@ -28,4 +29,11 @@ fi
VM="$1" VM="$1"
shift shift
exec /usr/bin/qvm-run --pass-io --localcmd "/usr/lib/qubes/qfile-dom0-agent $@" "$VM" "QUBESRPC qubes.Filecopy dom0" TMPDIR=`mktemp -d`
trap 'rm -rf -- "$TMPDIR"' EXIT
RESPONSE=$TMPDIR/response
mkfifo -- "$RESPONSE"
# can't use $@ with --localcmd, and $* would fail on whitespace
/usr/lib/qubes/qfile-dom0-agent "$@" <"$RESPONSE" |
qvm-run --pass-io "$VM" "QUBESRPC qubes.Filecopy dom0" >"$RESPONSE"

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# #
# The Qubes OS Project, http://www.qubes-os.org # The Qubes OS Project, http://www.qubes-os.org
# #
@ -20,14 +20,5 @@
# #
# #
if [ $# -lt 2 ] ; then . qvm-copy-to-vm "$@" &&
echo usage: $0 'dest_vmname file [file]+'
exit 1
fi
VM="$1"
shift
set -e
/usr/bin/qvm-run --pass-io --localcmd "/usr/lib/qubes/qfile-dom0-agent $@" "$VM" "QUBESRPC qubes.Filecopy dom0"
rm -rf -- "$@" rm -rf -- "$@"