Host file profile script.

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
bartszu
Level 4
Level 4
Posts: 361
Joined: Thu Aug 28, 2014 7:39 pm
Location: Eire

Host file profile script.

Post by bartszu »

Yo peeps.

I created 2 host files and some short "sudo cp" scripts for them.
My intention is quite simple, one script is coping "allow" host to etc, second script is coping "disallow" host to etc.
So I want functionality like: I want some parental control I run - "disallow script", party time I run - "allow script".
Seems quite simple but.
Some times FF keeps something in cache so some sites still loading after I run a script, not all but some.
This is not what I want, Bleachbit or reboot helps but this is not what I want.

I am looking for command or program with similar functionality.
But command fixing caches is fine.

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
bartszu
Level 4
Level 4
Posts: 361
Joined: Thu Aug 28, 2014 7:39 pm
Location: Eire

Re: Host file profile script.

Post by bartszu »

Hmm so i would have to add lines for browsers like:

rm ~/.mozilla/firefox/*.default/cookies.sqlite

There is any way to clean all at once ?
Habitual

Re: Host file profile script.

Post by Habitual »

~/.mozilla/firefox/*.default/places.sqlite is something I'd look at?

Good luck.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Host file profile script.

Post by Flemur »

You have two /etc/hosts files and want to switch between them?

I'm seeing two internet answers:
- that changes to /etc/hosts take place immediately.
- that you need to restart networking to see the changes.

A better solution would be to set up two browser profiles, one with a lot of blocking and one without.

I moved all my blocked URLs from /etc/hosts to privoxy, the main advantage being that you can't use wildcards in /etc/hosts, but you can with privoxy.

It's real easy to set up two browser profiles

Code: Select all

firefox -P profile.default -new-instance
firefox -P profile.safemode -new-instance
The first profile has lots of blocking: privoxy and adblock
The second doesn't use privoxy or adblock.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
bartszu
Level 4
Level 4
Posts: 361
Joined: Thu Aug 28, 2014 7:39 pm
Location: Eire

Re: Host file profile script.

Post by bartszu »

Ahha I found it ;)

sudo /etc/rc.d/init.d/nscd restart
Locked

Return to “Networking”