Mercurial > sat_docs
annotate scripts/dns_srv/configure_dns_srv.sh @ 14:51ce9c8ce18c
added announce for version 0.5
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 09 Sep 2014 07:32:47 +0200 |
parents | a6af040be754 |
children | 358a4fc0e091 |
rev | line source |
---|---|
3
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
1 #!/bin/bash |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
2 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
3 # This script allows you to quickly change your bind9 configuration: |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
4 # - define an internal domain and bind it to 127.0.0.1 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
5 # - add SRV records to use this domain with your local XMPP server |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
6 # |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
7 # BE SURE TO BACKUP /etc/bind AND /var/cache/bind BEFORE USING THIS SCRIPT! |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
8 # |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
9 # Configuration files based on: |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
10 # - http://www.madboa.com/geek/soho-bind |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
11 # - http://wiki.xmpp.org/web/SRV_Records |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
12 # - http://prosody.im/doc/dns |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
13 # |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
14 # For this to work, Prosody configuration must define the domain as a VirtualHost. |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
15 # It is also assumed that the Prosody "directory" option is set to "/var/cache/bind". |
4
a6af040be754
add screenshot for v0.5, Libervia's overview
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
16 # |
a6af040be754
add screenshot for v0.5, Libervia's overview
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
17 # Finally, you may want to modify the SàT configuration file to set the option |
a6af040be754
add screenshot for v0.5, Libervia's overview
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
18 # "new_account_domain" to that domain passed in $1 in order to register new |
a6af040be754
add screenshot for v0.5, Libervia's overview
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
19 # account from Libervia, and the "jid" option of sat_pubsub should be set to |
a6af040be754
add screenshot for v0.5, Libervia's overview
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
20 # "sat-pubsub.<domain>" for the microblogging feature to work. |
3
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
21 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
22 if [ $# -lt 2 ]; then |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
23 echo "Usage: `basename $0` <domain> <c2s_port>" |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
24 exit 1 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
25 fi |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
26 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
27 HOSTNAME=`cat /etc/hostname` |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
28 DOMAIN=$1 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
29 C2S_PORT=$2 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
30 DATE=`date +%s` |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
31 |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
32 mkdir -p /tmp/$DATE/ |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
33 cp -r template/* /tmp/$DATE/ |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
34 cd /tmp/$DATE |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
35 for FILE in `find . -type f`; do |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
36 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/` |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
37 done |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
38 /etc/init.d/bind9 restart |
73d3b94b7364
added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
39 tail /var/log/syslog |