~ubuntu-branches/ubuntu/precise/samba/precise-security

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# Try to bring nmbd up when an interface comes up, if smbd is already running.

# Don't bother to do anything for lo.
if [ "$IFACE" = lo ]; then
	exit 0
fi

# Only run from ifup.
if [ "$MODE" != start ]; then
	exit 0
fi

# Samba only cares about inet and inet6. Get thee gone, strange people
# still using ipx.
case $ADDRFAM in
	inet|inet6|NetworkManager)
		;;
	*)
		exit 0
		;;
esac


# Really only necessary to do anything if nmbd is not already running
if status smbd 2>/dev/null | grep -q "start/running" \
   && status nmbd 2>/dev/null | grep -q "stop/waiting"
then
	invoke-rc.d nmbd start >/dev/null
fi

exit 0