5

I'm setting up for a Proxmox 4 server a script that migrates OpenVZ dumps from a Proxmox 3.4. The scripts scp the backups, restores them and so on.

At a time of the process, I'd like to wipe /etc/network/interfaces and setup a new one using "pct set".

My problem is the following: to write default basic configuration into /etc/network/interface, I use lxt-attach. I mistakenly used this:

lxc-attach -n 101 -- echo "auto lo" > /etc/network/interfaces

You get it: I wiped my host's network config. So can someone tell me how to execute this command:

echo "auto lo" > /etc/network/interfaces

in a container using lxc-attach ?

Thanks a lot ;)

X99
  • 172
  • 2
  • 14

1 Answers1

5

As @jordanm said (see comments), this one works:

lxc-attach -n 101 -- bash -c 'echo "auto lo" > /etc/network/interfaces'
X99
  • 172
  • 2
  • 14