You are here
I tried adding the following to a patch but after I boot up the newly patched ISO image it's not changing the default network interfaces file.
iface="eth0"
ipadd="192.168.1.2"
subn="255.255.255.0"
gatew="192.168.1.1"
echo "#The loopback network interfaces" > /etc/network/interfaces
echo " auto lo" >> /etc/network/interfaces
echo " iface lo inet loopback" >> /etc/network/interfaces
echo " " >> /etc/network/interfaces
echo " " >> /etc/network/interfaces
echo "#The primary network interface" >> /etc/network/interfaces
echo " auto ${iface}" >> /etc/network/interfaces
echo " iface ${iface} inet static" >> /etc/network/interfaces
echo " address ${ipadd}" >> /etc/network/interfaces
echo " netmask ${subn}" >> /etc/network/interfaces
echo " gateway ${gatew}" >> /etc/network/interfaces
echo " dns-nameservers 8.8.8.8 8.8.4.4" >> /etc/network/interfaces
Any suggestions?
Thanks!
On face value that should work?!
I assume that this is in your conf script within the patch directory? If so, is it executable? Does it have a shebang? E.g. first line like this:
If it has all those things, then I would expect it to work?!
If you're not sure whether it's executable, check it with ls. I.e.:
If it's executable it should look like this:
Otherwise, it may look something like this (note no 'x's):
To make it executable:
I was going to lead you off on a bit of a tangent and suggest using Inithooks, but we don't use that ourselves and on inspection, it looks like it needs some tweaks to make it work as intended.
You could run through the process step-by-step to check that the interfaces file has been updated like this:
Also one other (sidetrack) point is that IMO it would be better to use what is called a heredoc rather than lots of echos. It would make it make easier to read. I.e. your script could look like this instead:
Although what you have should still work and there's nothing wrong with it (that I can see on face value). So my suggestion is more of an improvement for readability, rather than likely to make any material difference.
Add new comment