-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_www
executable file
·40 lines (34 loc) · 1.91 KB
/
start_www
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# echo -e 'db.host='${SQL_HOST}'\ndb.user='${SQL_USER}'\ndb.password='${SQL_PASSWORD} > /root/.hg.conf
# chmod 600 /root/.hg.conf
rm -f /var/www/cgi-bin/hg.conf
cp -f /opt/kent/src/product/ex.hg.conf /var/www/cgi-bin/hg.conf
sed -i 's/defaultGenome=.*/defaultGenome='"$DEFAULTGENOME"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/wiki\.host=.*/wiki\.host=HTTPHOST/g' /var/www/cgi-bin/hg.conf
sed -i 's/central\.domain=.*/central\.domain=HTTPHOST/g' /var/www/cgi-bin/hg.conf
sed -i 's/central\.host=.*/central\.host='"$SQL_HOST"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/db\.host=.*/db\.host='"$SQL_HOST"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/login\.browserName=.*/login\.browserName='"$BROWSERNAME"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/login\.browserAddr=.*/login\.browserAddr=http:\/\/'"${HOSTNAME}.${DOMAIN}"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/login\.mailSignature=Greenome Browser Staff=.*/login\.mailSignature=Greenome Browser Staff/g' /var/www/cgi-bin/hg.conf
sed -i 's/login\.mailReturnAddr=.*/login\.mailReturnAddr='"$WIKIEMAIL"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/custromTracks\.host=.*/custromTracks\.host=localhost/g' /var/www/cgi-bin/hg.conf
sed -i 's/customTracks\.host=.*/customTracks\.host='"$SQL_HOST"'/g' /var/www/cgi-bin/hg.conf
sed -i 's/customTracks\.user=.*/customTracks\.user=readwrite/g' /var/www/cgi-bin/hg.conf
sed -i 's/customTracks\.password=.*/customTracks\.password=update/g' /var/www/cgi-bin/hg.conf
sed -i 's#customTracks\.tmpdir=.*#customTracks\.tmpdir='/var/www/trash/ct'#g' /var/www/cgi-bin/hg.conf
sed -i 's#browser.documentRoot=.*#browser.documentRoot='/var/www'#g' /var/www/cgi-bin/hg.conf
if pgrep "httpd" > /dev/null; then
echo "httpd running, restarting"
apachectl -k graceful-stop
sleep 2
usermod -u $APACHE_UID apache
apachectl
else
echo "httpd not running, starting..."
usermod -u $APACHE_UID apache
apachectl
fi
update_html
update_cert
tail -f /var/log/httpd/access_log