View Full Version : Saving file
How can i save an edited /etc/hosts file? I just edited the hosts file with VI, and than save the file with:
flashfs save
flashfs commit
flashfs enable
When i check the hosts file after the reboot it has been restored like original.
Anyone a idea?
I'm using Oleg's firmware 1.9.2.7-6b
Thanks,
Roland
Edit:
Extra information: I'm using the WL500g in Home Gateway mode, maybe i need to change this to router?
TheEagle
15-11-2005, 20:50
Had the same problem with dnsmasq.conf, look here
http://wl500g.info/showthread.php?t=3697
Maybe you gather some useful information in this thread. A little test to see if you have the same problem as I have ... when router is booted, do
cat /etc/hosts
then
flashfs load
then
cat /etc/hosts
Check if the 2nd time the hosts file is what you wanted it to be.
You need to do:
echo "/etc/hosts" >> /usr/local/.files
before doing: flashfs save.
You need to do:
echo "/etc/hosts" >> /usr/local/.files
before doing: flashfs save.
I try this and when i now reboot the router there is added 2 times the entry:
127.0.0.1 localhost.localdomain localhost
192.168.1.20 my.router my.WL500g
This are the entry's i have:
127.0.0.1 localhost.localdomain localhost
192.168.1.20 my.router my.WL500g
192.168.1.10 somename.something
127.0.0.1 localhost.localdomain localhost
192.168.1.20 my.router my.WL500g
Got it now, i deleted everything but my own setting, then saved and rebooted en the settings are now correct.
Only strange thing that the hosts file isn't working as i would like, but that i give later a try. For now i have a changed hosts file.
FilimoniC
16-11-2005, 15:37
dnsmasq.conf can't be saved so!
Router generates this file at boot-time.
/etc/hosts is saved.
You need to edit the file and edit your settings, and you need to delete the default settings.
Then you need to save and reboot. The default settings are then added after the reboot, and your added settings are also safed.
This worked for me.
Roland
You've to use /usr/local/etc/hosts instead. Using /etc/hosts directly is not a good idea.
Thanks Oleg, didn't know that. Changed it to /usr/local/etc/hosts
Roland