ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/VPN/mpd-down.sh
Revision: 856
Committed: 2006-08-08T03:28:50-07:00 (18 years, 10 months ago) by douglas
Content type: text/x-sh
Original Path: FreeBSDAdmin/VPN/mpd-nsupdate-down.sh
File size: 565 byte(s)
Log Message:
Woo!

File Contents

# User Rev Content
1 douglas 856 #!/usr/local/bin/bash
2     # MPD Interface Down
3     #
4     # Douglas Thrift
5     #
6     # $Id$
7    
8     root=`dirname $0`
9     interface=`grep -E '^(pptp|ng)[0-9]$' <<<$1`
10     authname=$3
11    
12     if [[ -z $interface ]] || [[ $2 != inet ]] || [[ -z $authname ]] || [[ $# -ne 3 ]]; then
13     echo -e "Usage: `basename $0` \e[1minterface\e[0m inet \e[1mauthname\e[0m"
14     exit 1
15     fi
16    
17     read -r hostname reverse < ~/.mpd-nsupdate.$interface || exit $?
18    
19     source $root/mpd-nsupdate-common.sh
20    
21     nsupdate <<EOF
22     key $name $secret
23     update delete $hostname IN A
24     send
25     update delete $reverse IN PTR
26     send
27     EOF
28    
29     rm ~/.mpd-nsupdate.$interface

Properties

Name Value
svn:executable *
svn:keywords Id