]>
Commit | Line | Data |
---|---|---|
ab650faa DM |
1 | #!/bin/sh |
2 | ### BEGIN INIT INFO | |
3 | # Provides: rt_siteconfig | |
4 | # Required-Start: $remote_fs | |
5 | # Required-Stop: | |
6 | # X-Start-Before: apache2 | |
7 | # Default-Start: 2 | |
8 | # Default-Stop: | |
9 | # Short-Description: Generate RT Siteconfig | |
10 | # Description: Generate RT Siteconfig and gpg keys | |
11 | ### END INIT INFO | |
12 | ||
13 | set -e | |
14 | ||
15 | DOMAIN=`grep '^search' /etc/resolv.conf|awk '{ print $2; }'` | |
16 | HNAME=`head -n 1 /etc/hostname|awk '{ print $1; }'` | |
17 | ||
18 | if [ "X${HNAME}" = "Xlocalhost" ] ; then | |
19 | exit 0; | |
20 | fi | |
21 | ||
22 | FQDN=${HNAME}.${DOMAIN} | |
23 | ||
24 | cat >/etc/request-tracker3.8/RT_SiteConfig.d/50-debconf <<EOF | |
25 | # THE BASICS: | |
26 | ||
27 | Set(\$rtname, '${FQDN}'); | |
28 | Set(\$Organization, '${DOMAIN}'); | |
29 | ||
30 | Set(\$CorrespondAddress , 'rt@${FQDN}'); | |
31 | Set(\$CommentAddress , 'rt-comment@${FQDN}'); | |
32 | ||
33 | # THE WEBSERVER: | |
34 | ||
35 | Set(\$WebPath , "/rt"); | |
36 | Set(\$WebBaseURL , "http://${FQDN}"); | |
37 | ||
38 | EOF | |
39 | ||
40 | cat >/etc/request-tracker3.8/RT_SiteConfig.d/45-gnupg <<EOF | |
41 | # disable gnupg | |
42 | Set( %GnuPG, undef); | |
43 | Set(%GnuPGOptions, undef); | |
44 | 1; | |
45 | EOF | |
46 | ||
47 | update-rt-siteconfig-3.8 | |
48 | ||
49 | insserv -r setup-rt | |
50 | rm -f /etc/init.d/setup-rt |