master
1#!/bin/sh
2
3# load all the dependancies
4apt-get install vim bison libcurl4-gnutls-dev libxml2-dev -y --force-yes
5apt-get install byobu debhelper cdbs lintian build-essential fakeroot devscripts -y # postfix asks for config setup
6apt-get install ipsec-tools pbuilder dh-make debootstrap dpatch flex libmysqlclient15-dev ant docbook-to-man bind9 tmux -y
7sudo apt-get install subversion -y
8
9# work around to get oracle's (sun) JDK not in the repository
10cd /home/student/Desktop/
11wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.tar.gz"
12tar -zxvf jdk-7u40-linux-x64.tar.gz
13sudo mv -v jdk1.7.0_* /usr/lib/jvm
14
15# set the Java path - New for LINUX MINT
16sudo bash -c "echo JAVA_HOME=/usr/lib/jvm/jdk1.7.0_40 >> /etc/environment" #Set environment after reboot but won't help right now, so must also use export
17sudo chmod ugo=rx /usr/lib/jvm/jdk1.7.0_40/bin/java
18export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_40/bin/java # Set environemental variable right now
19
20# make all the directories
21sudo mkdir /opt
22sudo mkdir /opt/OpenIMSCore
23sudo mkdir /opt/OpenIMSCore/ser_ims
24sudo mkdir /opt/OpenIMSCore/FHoSS
25
26# load the SER code into the ser_ims directory, and the HSS managment code into the FHoSS directory
27sudo svn checkout http://svn.berlios.de/svnroot/repos/openimscore/ser_ims/trunk /opt/OpenIMSCore/ser_ims # Takes some time
28sudo svn checkout http://svn.berlios.de/svnroot/repos/openimscore/FHoSS/trunk /opt/OpenIMSCore/FHoSS
29
30cd /opt/OpenIMSCore/ser_ims
31make install-libs all
32
33cd /opt/OpenIMSCore/FHoSS
34ant compile
35ant deploy
36cd /opt/OpenIMSCore/FHoSS/deploy
37chmod -R 777 . # Make this directory writable
38
39
40cd /opt/OpenIMSCore
41sudo apt-get install mysql-server -y # User must press enter 3 times (blue screens - don't set a MySQL password).
42echo "You will be asked three times for a password, use arg"
43mysql -u root -p -h localhost < ser_ims/cfg/icscf.sql # When prompted for a password at the terminal CLI, enter your sudo password
44mysql -u root -p -h localhost < FHoSS/scripts/hss_db.sql
45mysql -u root -p -h localhost < FHoSS/scripts/userdata.sql
46
47#Make sure student login can access database rather than "hssAdmin"
48mysql -uroot -parg <<QUERY_INPUT
49GRANT ALL PRIVILEGES ON *.* TO "student"@"localhost" IDENTIFIED BY "arg";
50FLUSH PRIVILEGES;
51QUERY_INPUT
52
53#Copy startup files to /opt/OpenIMSCore
54sudo cp /opt/OpenIMSCore/ser_ims/cfg/*.cfg .
55sudo cp /opt/OpenIMSCore/ser_ims/cfg/*.xml .
56sudo cp /opt/OpenIMSCore/ser_ims/cfg/*.sh .
57sudo cp /opt/OpenIMSCore/ser_ims/cfg/open-ims.dnszone /etc/bind
58echo 'zone "open-ims.test" { type master; file "/etc/bind/open-ims.dnszone"; };' >> /etc/bind/named.conf.local
59/etc/init.d/bind9 restart
60mkdir /etc/studentconf
61mkdir /etc/studentconf/openimscore
62
63# Copy launchers, scripts, and menu files to where they belong assuming source is in MINT folder on desktop
64sudo cp /home/student/Desktop/MINT/OpenIMS/imsCore.sh /etc/studentconf/openimscore
65chmod 777 /etc/studentconf/openimscore/imsCore.sh
66chgrp student /etc/studentconf/openimscore/imsCore.sh
67sudo cp /home/student/Desktop/MINT/OpenIMS/kill_tmux.desktop /usr/share/applications
68sudo cp /home/student/Desktop/MINT/OpenIMS/StartIMScore.desktop /usr/share/applications
69# sudo cp alta3.menu /etc/xdg/ # Edit this to target correct file once it is discovered
70
71echo " "
72echo "OpenIMSCore installation complete! You will need to reboot your machine before booting OpenIMSCore for the first time."
73echo " "
74read -p "<Press 'Enter' to exit>" waiting
75