4 ms·
Create 2 files hosts.work & hosts.play in /etc Add these 2 lines into .profile or .bash_profile alias work='sudo cp -f /etc/hosts.work /etc/hosts' alias play
by xuki 16y ago
Create 2 files hosts.work & hosts.play in /etc
Add these 2 lines into .profile or .bash_profile
alias work='sudo cp -f /etc/hosts.work /etc/hosts'
alias play='sudo cp -f /etc/hosts.play /etc/hosts'
If you don't want to sudo, chmod /etc/hosts.
- yogsototh 16y agoGreat idea! Should be mixed with crontab that disable "play mode" every 30 minutes forcing you to manually copy the play host file.
- loire280 16y agoJust remember to be careful with changing permissions on your hosts file. You wouldn't want an unprivileged user to be adding lines to it. 69.57.123.17 your-bank.com
- rhizome 16y agoalias work='sudo ln -sf /etc/hosts.work /etc/hosts' alias play='sudo ln -sf /etc/hosts.play /etc/hosts'