Magellan Linux

Contents of /trunk/ppp/ip-downd-30-wins.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 796 - (show annotations) (download) (as text)
Mon May 11 09:39:21 2009 UTC (15 years ago) by niro
File MIME type: application/x-sh
File size: 618 byte(s)
new ip up down from gentoo

1 #!/bin/sh
2
3 # Remove WINS servers from smb.conf
4 # Used parameters and environment variables:
5 # $1 - interface name (e.g. ppp0)
6 # $USEPEERWINS - set if user specified usepeerdns
7 # $WINS1 and $WINS2 - WINS servers reported by peer
8
9 if [ "$USEPEERWINS" = 1 -a -f /etc/samba/smb.conf ]; then
10 # Remove the WINS servers
11 winsservers=
12 [ -n "$WINS1" ] && winsservers="$winsservers $1:$WINS1"
13 [ -n "$WINS2" ] && winsservers="$winsservers $1:$WINS2"
14 sed -i -e "s/^\([[:space:]]*wins[[:space:]]*server[[:space:]]*=[^#]*\) $winsservers /\1/i" /etc/samba/smb.conf
15
16 # Reload nmbd configuration
17 smbcontrol nmbd reload-config
18 fi