Changing the dhcp IP range in Virbr0's XML file using virsh in bash script

前端 未结 1 1215
别那么骄傲
别那么骄傲 2021-01-19 04:01

I need to change the dhcp range of Virbr0\'s XML configuration file within a bash script. It can be changed using the command \"virsh net-edit default\", but I don\'t know h

相关标签:
1条回答
  • 2021-01-19 04:10

    net-edit invokes the editor set in EDITOR, so you should be able to set that to a non-interactive editor:

    EDITOR='sed -i s/foo/bar/g' virsh net-edit default
    

    Depending on how exactly virsh invokes it, you may have to wrap your editing code in a script that modifies the filename given in "$1", then set EDITOR to that script.

    0 讨论(0)
提交回复
热议问题