You are not logged in.
Pages: 1
null
Last edited by gromlok (2019-03-10 15:36:24)
.
Offline
cat /etc/hosts.standard > /etc/hosts
cat /etc/hosts.tor >> /etc/hosts
cat /etc/hosts.pages >> /etc/hosts
cat /etc/hosts.X >> /etc/hostsMaintain your separate files as hosts.<whatever> then use a script like the above to consolidate them into the actual /etc/hosts file
EDIT: Yes, the first line has ONE > symbol (that overwrites the file with the contents of hosts.standard) and the rest have TWO >> symbols (to append the other files, rather than overwrite)
Last edited by fukawi2 (2010-11-05 23:32:43)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
null
Last edited by gromlok (2019-03-10 15:36:35)
.
Offline
TS=`date +%m-%d-%y %H:%M:%S`
mv /etc/host ~/myhost/backups/hosts$TSUsing a pipe ('|') in file names is a bad idea
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Or you could use dnsmasq if you don't mind having another daemon running, as a bonus you get dns caching. In the configuration file you then tell it to load several separate files, all with the correct hosts file syntax.
@fukawi2
Don't you mean
TS=`date "+%m-%d-%y %H:%M:%S"`
mv /etc/host "~/myhost/backups/hosts$TS"R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
also see this
Offline
@fukawi2
Don't you mean
Errr, yeah... Forgot there was a space in there, thx for picking that up ![]()
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Just to make fukawi2's script idea more manageable. i.e no matter how many host files you have.
cat /etc/hosts.* > /etc/hostsEDIT: Damm hosts.allow and hosts.deny - You must be able to omit those somehow
Last edited by gazj (2010-11-06 14:21:24)
Offline
null
Last edited by gromlok (2019-03-10 15:36:46)
.
Offline
Pages: 1