annotate scripts/dns_srv/configure_dns_srv.sh @ 118:12cb931dbea0

docker (base): fixed bad escaping in add_host script, resulting in domain not put in /etc/hosts
author Goffi <goffi@goffi.org>
date Tue, 08 Mar 2016 17:54:11 +0100
parents 358a4fc0e091
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 #
48
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
7 # It will mess up your actual bind9 configuration. It should not be used on
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
8 # production servers but only on your development machine with local servers.
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
9 # USE AT YOUR OWN RISK! Be sure to BACKUP /etc/bind and /var/cache/bind before!
3
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
10 #
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
11 # 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
12 # - 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
13 # - 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
14 # - 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
15 #
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
16 # 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
17 # 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
18 #
48
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
19 # Finally, you may want to modify your SàT configuration file to set the option
4
a6af040be754 add screenshot for v0.5, Libervia's overview
souliane <souliane@mailoo.org>
parents: 3
diff changeset
20 # "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
21 # account from Libervia, and the "jid" option of sat_pubsub should be set to
48
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
22 # "sat-pubsub.<domain>" for the (micro)blogging feature to work.
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
23 #
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
24 # You can also check this page with additional information about how to restore
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
25 # your previously configured domains (if any...) after having ran the script:
358a4fc0e091 scripts (dns_srv): update script usage information
souliane <souliane@mailoo.org>
parents: 4
diff changeset
26 # http://wiki.goffi.org/wiki/How_to_change_your_Libervia%27s_domain_name/en
3
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
27
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
28 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
29 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
30 exit 1
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
31 fi
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
32
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
33 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
34 DOMAIN=$1
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
35 C2S_PORT=$2
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
36 DATE=`date +%s`
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
37
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
38 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
39 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
40 cd /tmp/$DATE
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
41 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
42 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
43 done
73d3b94b7364 added DNS SRV configuration script + move launching script to scripts/launcher/launch.sh
souliane <souliane@mailoo.org>
parents:
diff changeset
44 /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
45 tail /var/log/syslog