On 1/5/19 1:13 AM, 799 wrote:

    The restart-function is available in the right-click-menue of a vm in
    the Qube Manager. Could this also be provided for the CLI as a
    "qvm-restart" command?

You can easily write a script yourself:

#!/bin/bash
qvm-shutdown --wait $1 && qvm-start $1


This won't work non sys-net, sys-firewall ... for example. You might want to

1) first find appVMs that use $1 as netvm
2) set their netvm to "none"
3) then qvm-shutdown $1
4) then qvm-start $1
5) then reset netvm's to back to $1.

steps 3 &4 are clear (see above). Step 1 can be done using Chris' "findpref" command (see https://github.com/tasket/Qubes-scripts ) :

   findpref --pref sysnet $1  | cut -f5 -d" "

will output all appVM's that use $1 as sys-net. I am not a real bash-champion, but I'd try

    APPVMS=`findpref --pref sysnet $1  | cut -f5 -d" "`

to store the concerned APPVMS in step one in a string. Then I would try

   for APPVM in APPVMS; do  findpref --pref sysnet $APPVM none; done

to do step 2  and

for APPVM in APPVMS; do  findpref --pref sysnet $APPVM $1; done

to set them back. So all together:


#!/bin/bash
allAPPVMS=`findpref --pref sysnet $1  | cut -f5 -d" "`
for eachAPPVM in allAPPVMS; do findpref --pref sysnet $eachAPPVM none; done
qvm-shutdown --wait $1 && qvm-start $1
for eachAPPVM in allAPPVMS; do  findpref --pref sysnet $eachAPPVM $1; done


I did not test this, spo please re-read the findpref usage first! Is there some improvement by the community ?? Bernhard

--
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/82338765-257f-1f73-ef20-a556321cde05%40web.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to