<div dir="ltr"><div><div>Thanks for the input Jason. Is it really the case that the hostname command can set other entries in /etc/hosts (which is what I want to do)? I thought it could only set the hostname of the machine it was running.<br><br></div>Looks like I could use netctl to run an arbitrary command upon connection to a home network: <a href="https://wiki.archlinux.org/index.php/netctl#Execute_commands_on_established_connection">https://wiki.archlinux.org/index.php/netctl#Execute_commands_on_established_connection</a><br><br></div>I've used wicd before. Maybe I'll go back to it if I can't get netctl to do what I want.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 28, 2016 at 11:46 AM, Jason Irwin <span dir="ltr"><<a href="mailto:jasonirwin73@gmail.com" target="_blank">jasonirwin73@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah....the venerable VM SuperFlub. They work (kinda), but I'm not sure<br>
how they deal with their WAN IP being used from the LAN side. Badly,<br>
if your experience is anything to go by!<br>
I use a Buffalo AirStation with the VM box in modem-mode. Works well<br>
enough for my purposes but I'd not recommend one.<br>
As to DD-WRT; I'd check OpenWRT compatibility before buying. I am<br>
informed OpenWRT is superior an have every intention of trying it out.<br>
<br>
Getting/Setting the hostname is done with "hostname". Setting needs<br>
elevate privileges which your script may or may not depending on how<br>
it gets run.<br>
<br>
"netcfg current" tells you which profiles are running and that would<br>
seem to be the way to find out if you're home or not.<br>
The up/down stuff is bound to the actual interface rather than<br>
profile. So I don't think that will detect a profile switch.<br>
<br>
"/etc/hosts" really is for static stuff, this dynamic IP should<br>
probably be set in dnsmasq, bind9 or whatever you use<br>
("address=/blah/<a href="http://1.2.3.4" rel="noreferrer" target="_blank">1.2.3.4</a>" etc) and that have it reload/restart.<br>
<br>
What about running "wicd"? <a href="https://wiki.archlinux.org/index.php/wicd#Scripts" rel="noreferrer" target="_blank">https://wiki.archlinux.org/index.php/wicd#Scripts</a><br>
I guess other GUIs may have similar support.<br>
<br>
Can't help but think there has to be a really easy way to run<br>
something based on a profile switch. Seems like an obvious thing to<br>
want to do.<br>
Just can't find anything.<br>
<br>
J.<br>
WARNING: DO NOT take network advice from this man.<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Nottingham mailing list<br>
<a href="mailto:Nottingham@mailman.lug.org.uk">Nottingham@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/nottingham" rel="noreferrer" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/nottingham</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><font color="#000000">Redwood Legal</font></div><div style="font-size:small"><font color="#000000"><a href="mailto:rp@redwoodlegal.co.uk" target="_blank">rp@redwoodlegal.co.uk</a><br></font></div><div style="font-size:small"><font color="#000000">Office: 02030 956010</font></div><div style="font-size:small"><font color="#000000">138-140 Southwark Street, London, SE1 0SW<br></font></div><div style="font-size:small"><font color="#000000"><br></font></div><div style="font-size:small"><font color="#000000">This firm is authorised and regulated by the Solicitors Regulation Authority (SRA ID 427552)</font><br></div></div></div></div></div></div></div></div></div>
</div>