3 SAMBA_DHCP_CONF
=/etc
/samba
/dhcp.conf
4 SAMBA_DHCP_CONF_INFO_FILE
=""
7 # No need to continue if we're called with an unsupported option
9 if [ "$reason" != BOUND
] && [ "$reason" != RENEW
] \
10 && [ "$reason" != REBIND
] && [ "$reason" != REBOOT
] \
11 && [ "$reason" != EXPIRE
] && [ "$reason" != FAIL
]
16 # Nor should we continue if no settings have changed
17 if [ "$new_netbios_name_servers" = "$old_netbios_name_servers" ] \
18 && [ "$new_netbios_scope" = "$old_netbios_scope" ] \
19 && [ -f $SAMBA_DHCP_CONF ]
24 # reparse our own file
25 local other_servers
=`sed -n -e"s/[[:space:]]$interface:[^[:space:]]*//g; \
26 s/^[[:space:]]*wins server[[:space:]]*=[[:space:]]*//pi" \
31 local serverlist
="$other_servers"
32 for server
in $new_netbios_name_servers
34 serverlist
="$serverlist $interface:$server"
37 echo -n > $SAMBA_DHCP_CONF
38 test -n "$SAMBA_DHCP_CONF_INFO_FILE" -a -f "$SAMBA_DHCP_CONF_INFO_FILE" && \
39 cat "$SAMBA_DHCP_CONF_INFO_FILE" >> $SAMBA_DHCP_CONF
41 # If we're updating on failure/expire, AND there are no WINS
42 # servers for other interfaces, leave the file empty.
43 if [ -z "$other_servers" ]
45 if [ "$reason" = FAIL
] ||
[ "$reason" = EXPIRE
]
51 if [ -n "$serverlist" ]
53 echo " wins server =$serverlist" >> $SAMBA_DHCP_CONF
55 if [ -n "$new_netbios_scope" ]
57 echo " netbios scope = $new_netbios_scope" >> $SAMBA_DHCP_CONF
61 # Only call netbios_setup if we're not sourced.
63 *bin
/sh|
*bin
/bash
) : ;;