[Nottingham] AutoSSH - graceful disconnect?

Mike Cardwell nlug at lists.grepular.com
Thu Aug 27 13:49:13 UTC 2015


* on the Thu, Aug 27, 2015 at 02:39:29PM +0100, Jason Irwin wrote:

> Actually, I take that back. What appears to be happening is that the
> autossh script in /etc/network/if-up.d/ is getting run twice on boot for
> some reason. Which has me puzzled - isn't that the correct place for a
> script to live so it gets run when the network is up? (Routable IP etc etc).

My understanding is that scripts in /if-up.d/ get run every time any interface
is brought up. So if you're bringing up 2 interfaces, it will get run twice.
It looks like a number of environment variables are set before the script
is run, so you can check inside the script which interface is being brought
up and respond accordingly. I.e, exit if it's not eth0 or whatever. I can
see a number of scripts in there on my system that do things like:

if [ "$IFACE" != lo ]; then
    blah blah blah
fi

-- 
Mike Cardwell  https://grepular.com https://emailprivacytester.com
OpenPGP Key    35BC AF1D 3AA2 1F84 3DC3   B0CF 70A5 F512 0018 461F
XMPP OTR Key   8924 B06A 7917 AAF3 DBB1   BF1B 295C 3C78 3EF1 46B4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 598 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/nottingham/attachments/20150827/326f04a0/attachment.sig>


More information about the Nottingham mailing list