source: trunk/gsdl3/gs3-finalise.sh@ 6442

Last change on this file since 6442 was 6433, checked in by kjdon, 20 years ago

new install and launching scripts

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1#!/bin/sh
2
3## gs3-finalise.sh -- Install Greenstone 3
4
5#check that GSDL3HOME is set
6if test -z "$GSDL3HOME" ; then
7 echo "You need to 'source gs3-setup.sh' before running the finalise script"
8 exit;
9fi
10gsdl3home=$GSDL3HOME
11# Prompt for the computer name
12hostname="localhost"
13echo ""
14echo "Enter the full address of the host computer from which the greenstone"
15echo "collections will be served, for example:"
16echo "bob.greenstone.ac.nz"
17echo "or press enter for default [Default = localhost]."
18echo ""
19printf "%s" "> "
20read ans
21if [ "$ans" != "" ] ; then
22 hostname="$ans"
23fi
24
25# Prompt for the port number
26portnumber="8080"
27echo ""
28echo "Enter the port number that the tomcat webserver will serve on,"
29echo "or press enter for default [Default = 8080]."
30echo ""
31printf "%s" "> "
32read ans
33if [ "$ans" != "" ] ; then
34 portnumber="$ans"
35fi
36
37# Edit the comms/jakata/tomcat/conf/server.xml file and set the gsdl3home and hostname variables
38sed "s|@gsdl3home@|${gsdl3home}|" ./comms/jakarta/tomcat/conf/server.xml.in > ./comms/jakarta/tomcat/conf/server.xml
39if [ "$portnumber" != "8080" ] ; then
40 sed "s|8080|${portnumber}|" ./comms/jakarta/tomcat/conf/server.xml > ./comms/jakarta/tomcat/conf/server.tmp && mv ./comms/jakarta/tomcat/conf/server.tmp ./comms/jakarta/tomcat/conf/server.xml
41fi
42
43# Edit the web/WEB-INF/web.xml to set gsdl3home
44sed "s|@gsdl3home@|${gsdl3home}|" ./web/WEB-INF/web.xml.in > ./web/WEB-INF/web.xml
45
46# Edit the siteConfig.xml found in any site within the sites folder
47for SITE in $gsdl3home/web/sites/*; do
48 if [ -f $SITE/siteConfig.xml ] ; then
49 echo "Processing $SITE"
50 if [ "$hostname" != "localhost" ] ; then
51 sed "s|localhost|${hostname}|" $SITE/siteConfig.xml > $SITE/siteConfig.tmp && mv $SITE/siteConfig.tmp $SITE/siteConfig.xml
52 fi
53 if [ "$portnumber" != "8080" ] ; then
54 sed "s|8080|${portnumber}|" $SITE/siteConfig.xml > $SITE/siteConfig.tmp && mv $SITE/siteConfig.tmp $SITE/siteConfig.xml
55 fi
56 fi
57done
58
59# set up the sql db
60pushd $GSDL3HOME/packages/mysql
61./bin/mysql_install_db
62#./bin/mysql_safe &
63./bin/mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
64./bin/mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
65#./bin/mysqladmin shutdown
66popd
67
68
69# We also edit the GSDL3 launching script
70if [ "$hostname" != "localhost" ] ; then
71 sed "s|localhost|${hostname}|" gs3-launch.sh > gs3-launch.tmp && mv gs3-launch.tmp gs3-launch.sh
72fi
73if [ "$portnumber" != "8080" ] ; then
74 sed "s|8080|${portnumber}|" gs3-launch.sh > gs3-launch.tmp && mv gs3-launch.tmp gs3-launch.sh
75fi
76
77# Make the GSDL3 script executable
78chmod u+x gs3-launch.sh
79
80# And provide a nice little postscript
81echo ""
82echo "****************************************************************"
83echo "Greenstone 3 - Installation Complete!"
84echo ""
85echo "Change to the folder denoted below and run gs3-launch.sh to start the"
86echo "web server:"
87echo ""
88echo " $GSDL3HOME"
89echo ""
90echo "****************************************************************"
91echo ""
92
93exit 0
Note: See TracBrowser for help on using the repository browser.