From ba6b55ed652857082d7702c29923af2168f00308 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 13 Jun 2007 22:34:33 +0000 Subject: * Add /etc/network/if-up.d/openssh-server to restart sshd when new interfaces appear (LP: #103436). --- debian/openssh-server.if-up | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 debian/openssh-server.if-up (limited to 'debian/openssh-server.if-up') diff --git a/debian/openssh-server.if-up b/debian/openssh-server.if-up new file mode 100644 index 000000000..67f06c094 --- /dev/null +++ b/debian/openssh-server.if-up @@ -0,0 +1,30 @@ +#! /bin/sh +# Reload the OpenSSH server when an interface comes up, to allow it to start +# listening on new addresses. + +set -e + +# Don't bother to restart sshd when lo is configured. +if [ "$IFACE" = lo ]; then + exit 0 +fi + +# Only run from ifup. +if [ "$MODE" != start ]; then + exit 0 +fi + +# OpenSSH only cares about inet and inet6. Get thee gone, strange people +# still using ipx. +if [ "$ADDRFAM" != inet ] && [ "$ADDRFAM" != inet6 ]; then + exit 0 +fi + +# Is /usr mounted? +if [ ! -e /usr/sbin/sshd ]; then + exit 0 +fi + +/etc/init.d/ssh reload >/dev/null 2>&1 + +exit 0 -- cgit v1.2.3