billw2 / rpi-clone

A shell script to clone a booted disk.
BSD 3-Clause "New" or "Revised" License
2.49k stars 327 forks source link

Feature request: Change of IPaddress #97

Closed SargonofAssyria closed 4 years ago

SargonofAssyria commented 4 years ago

It would be nice if the rpi-clone-setup script could change the IPaddress of the clone too.

billw2 commented 4 years ago

There are too many variations on neworking setups for rpi-clone to do that reliably. It's what the rpi-clone-setup script is for. Edit that to change your IP in hosts files and networking files. Then run rpi-clone with the -s option option so it runs the setup script. I do this for my clones where I clone to several different Pi installations with hostnames ranging like rpi0, rpi1, etc. So I run rpi-clone on rpi0 and run a setup for rpi1 with: rpi-clone -s rpi1

Then my rpi-clone-setup change files for hostame (/etc/hostname) and for networking. All my Pis connect via dhcp but my setup script sets up a fixed LAN IP address for each one by setting the IP address with a "ip address add ..." command in a /etc/dhcpcd.exit-hook script. Your setup is likely different and I would not know what to tell rpi-clone to do.

SargonofAssyria commented 4 years ago

Ok, tnx. I will do by scripting.