summaryrefslogtreecommitdiff
path: root/debian/openssh-server.if-up
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-06-13 22:34:33 +0000
committerColin Watson <cjwatson@debian.org>2007-06-13 22:34:33 +0000
commitba6b55ed652857082d7702c29923af2168f00308 (patch)
tree0a9efbdf5e425cb6132fa241266666c3c97ba8c7 /debian/openssh-server.if-up
parenta4d3beb36250111e9b1e5991e8b79a794022c8f0 (diff)
* Add /etc/network/if-up.d/openssh-server to restart sshd when new
interfaces appear (LP: #103436).
Diffstat (limited to 'debian/openssh-server.if-up')
-rw-r--r--debian/openssh-server.if-up30
1 files changed, 30 insertions, 0 deletions
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 @@
1#! /bin/sh
2# Reload the OpenSSH server when an interface comes up, to allow it to start
3# listening on new addresses.
4
5set -e
6
7# Don't bother to restart sshd when lo is configured.
8if [ "$IFACE" = lo ]; then
9 exit 0
10fi
11
12# Only run from ifup.
13if [ "$MODE" != start ]; then
14 exit 0
15fi
16
17# OpenSSH only cares about inet and inet6. Get thee gone, strange people
18# still using ipx.
19if [ "$ADDRFAM" != inet ] && [ "$ADDRFAM" != inet6 ]; then
20 exit 0
21fi
22
23# Is /usr mounted?
24if [ ! -e /usr/sbin/sshd ]; then
25 exit 0
26fi
27
28/etc/init.d/ssh reload >/dev/null 2>&1
29
30exit 0