On 07/05/2016 12:04 AM, Eva Star wrote:
How to check that file exists on AppVm from dom0 bash script?

Or simple get the exit code of the remote process?

status=$(qvm-run --pass-io $appvm "test -r $file; echo $?" >
file_with_exit_code_always_with_null_why

no need to echo $?, the exit code is passed to dom0 too. Eg.:

# qvm-run --pass-io $appvm "test -e /bin/ls"
# echo $?
0

# qvm-run --pass-io $appvm "test -e /bin/blah"
# echo $?
1



status=$(qvm-run --pass-io $appvm "cat $file" > dom0file
If $file is not exists how to get notify about it on bash script?

if ! $(qvm-run --pass-io $appvm "test -e $file"); then your_commands_here; fi

but you'll also catch qvm-run errors (eg. $appvm not running). A workaround would be to choose a custom exit value, like so:

qvm-run --pass-io $appvm "test -e $file || exit 199"
if [ $? -eq 199 ]; then
        your_commands_here
fi




thanks


--
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/3aac039b-1b92-12ec-893f-750495c788c4%40c3i.bg.
For more options, visit https://groups.google.com/d/optout.

Reply via email to