Mercurial > sat_docs
comparison scripts/dns_srv/configure_dns_srv.sh @ 3:73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 27 Jun 2014 19:17:18 +0200 |
parents | |
children | a6af040be754 |
comparison
equal
deleted
inserted
replaced
2:3ec5808e3b53 | 3:73d3b94b7364 |
---|---|
1 #!/bin/bash | |
2 | |
3 # This script allows you to quickly change your bind9 configuration: | |
4 # - define an internal domain and bind it to 127.0.0.1 | |
5 # - add SRV records to use this domain with your local XMPP server | |
6 # | |
7 # BE SURE TO BACKUP /etc/bind AND /var/cache/bind BEFORE USING THIS SCRIPT! | |
8 # | |
9 # Configuration files based on: | |
10 # - http://www.madboa.com/geek/soho-bind | |
11 # - http://wiki.xmpp.org/web/SRV_Records | |
12 # - http://prosody.im/doc/dns | |
13 # | |
14 # For this to work, Prosody configuration must define the domain as a VirtualHost. | |
15 # It is also assumed that the Prosody "directory" option is set to "/var/cache/bind". | |
16 | |
17 if [ $# -lt 2 ]; then | |
18 echo "Usage: `basename $0` <domain> <c2s_port>" | |
19 exit 1 | |
20 fi | |
21 | |
22 HOSTNAME=`cat /etc/hostname` | |
23 DOMAIN=$1 | |
24 C2S_PORT=$2 | |
25 DATE=`date +%s` | |
26 | |
27 mkdir -p /tmp/$DATE/ | |
28 cp -r template/* /tmp/$DATE/ | |
29 cd /tmp/$DATE | |
30 for FILE in `find . -type f`; do | |
31 sed -e s/\<domain\>/$DOMAIN/g -e s/\<hostname\>/$HOSTNAME/g -e s/\<date\>/$DATE/g -e s/\<c2s_port\>/$C2S_PORT/g $FILE > `echo $FILE | sed -e 's/^.//' -e s/my.domain/$DOMAIN/` | |
32 done | |
33 /etc/init.d/bind9 restart | |
34 tail /var/log/syslog |