Hi Folks!!

Today I finished the update of the Automagic script for the new release (3087).

Sebastian, could you please, update the script on SVN?

[]'s

Victor

--
You received this message because you are subscribed to the Google Groups 
"OpenMeetings User" group.
To post to this group, send email to openmeetings-u...@googlegroups.com.
To unsubscribe from this group, send email to 
openmeetings-user+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/openmeetings-user?hl=en.

#!/bin/bash

#Install Script for Openmeetings release 3087 
#Original idea: Victor Sartori - vic...@sartori.eti.br


#Instructions

# The variables: INSTALL_HOME, REP_DEBIAN, SITE and FILE is required
# Adjust the Debian repository for your country
# The variables SITE and FILE works like this:
#  You need to split the URL, cutting the path to file and the file like the 
example above:
#  the URL: 
http://openmeetings.googlecode.com/files/openmeetings_1_1_r3087.zip, you need 
split the path to file, so the
#variable SITE must contain the value: http://openmeetings.googlecode.com/files 
without the slash at end.
# The variable FILE, will be receive the file will be downloaded like: 
openmeetings_1_1_r3087.zip

# This is a "Automagic" installer

#This script is designated by DEBIAN 5 USERS! therefore UBUNTU USERS, this 
script will not work for you, he needs adaptations.

#How to use?
# You need to set the eXecute permission for this script: chmod +x 
install-om-3087
# and to run: ./install-om-r3095 simple!


#To Do:
# Make support for others distributions


#ChangeLog
# Added support for the last stable version r3087
# Fixed the issue with videos, now is not needed recompile ffmpeg


#Return codes:

#1 - Without root power
#2 - Variable REP_DEBIAN empty
#3 - Variables SITE and FILE empty
#4 - Variable INSTALL_HOME empty
#5 - Blank passwords for MySQL root user or Openmeetings user
#6 - Unknow Linux system (different of debian)


#Questions, suggestions, bugs.... anything, mail-me: vic...@sartori.eti.br


# Thats all Folks!!!! enjoy

#--Victor

#--------------------------------------------------------------------------------------------------------------------
BASE_INSTALL=/opt
INSTALL_HOME=/opt/red5
REP_DEBIAN=http://ftp.us.debian.org/debian/
SITE=http://openmeetings.googlecode.com/files 
FILE=openmeetings_1_1_r3087.zip


menu() {
        clear
        echo "OpenMeetings \"Automagic\" Install-Script - v0.11 - By Victor"
        echo "-------------------------------------------------------------"
        echo "Choose one option:"
        echo
        echo "1 - Install"
        echo "2 - Remove (only files, init scripts and database openmeetings)"
        echo "3 - Quit"
        echo
        echo -n "Choose your option: "
        read opcao
        case $opcao in
                1) Install ;;
                2) Remove ;;
                3) exit;;
                *) "Wrong Option" ; sleep 2 ; menu ;; 
        esac
}



Install(){
        repositories
        downloads
        copy_files
        database
        mysql_connection
        start_services
}

Remove(){
        rep_original
        del_files
        del_database

}

rep_original() {
        mv -f /etc/apt/sources.list /etc/apt/sources.list.openmeetings
        mv -f /etc/apt/sources.list.orig /etc/apt/sources.list
        aptitude update
}

del_files() {
        /etc/init.d/red5 stop
        /etc/init.d/openoffice stop
        update-rc.d -f red5 remove
        update-rc.d -f openoffice remove
        rm -rf $INSTALL_HOME
}
del_database(){
        echo -n "Type the MySQL root password: "
        read ROOT_MYSQL

        echo "DROP USER openmeeti...@localhost;" |mysql -u root -p$ROOT_MYSQL
        echo "DROP DATABASE openmeetings;" |mysql -u root -p$ROOT_MYSQL
}

repositories() {
        if [ -z $REP_DEBIAN ]; then     
                echo "The variable REP_DEBIAN is required!"
                echo "Edit this script and fill value with a valid Debian 
repository."
                echo "The install script will be not completed."
                echo "Error code 2"
                exit 2
        else
                mv -f /etc/apt/sources.list /etc/apt/sources.list.orig
                echo "#Generated by Openmeetings Installer

                deb $REP_DEBIAN lenny main contrib non-free
                deb http://security.debian.org/ lenny/updates main contrib 
non-free
                deb-src http://security.debian.org/ lenny/updates main contrib 
non-free
                deb http://volatile.debian.org/debian-volatile lenny/volatile 
main contrib non-free
                deb-src http://volatile.debian.org/debian-volatile 
lenny/volatile main contrib non-free
                deb http://ftp.br.debian.org/debian-multimedia/ lenny main
                " > /etc/apt/sources.list
                gpg --keyserver subkeys.pgp.net --recv 07DC563D1F41B907
                gpg --export --armor 07DC563D1F41B907 | apt-key add -   
                aptitude update
        fi
}

downloads() {

        if [[ -z $SITE || -z $FILE ]]; then
                echo "The variables SITE and FILE is required!"
                echo "Edit this script and fill value."
                echo "At SITE variable, put the only the website, like: 
site.com/directory (without slash at end)"
                echo "At FILE variable, put the file will be downloaded, like: 
file.zip"
                echo "The Install Script will be not completed."
                echo "Error code 3"
                exit 3
        else
                aptitude install -y debian-multimedia-keyring sun-java6-jdk 
                aptitude install -y mysql-server openoffice.org-headless 
openoffice.org-writer openoffice.org-calc openoffice.org-impress 
openoffice.org-draw openoffice.org-math imagemagick gs-gpl libart-2.0-2 libt1-5 
libungif4g zip unzip bzip2 subversion git-core checkinstall yasm texi2html 
libfaac-dev libfaad-dev libmp3lame-dev  libsdl1.2-dev libx11-dev libxfixes-dev 
libxvidcore4-dev zlib1g-dev libogg-dev sox libvorbis0a libvorbis-dev libgsm1 
libgsm1-dev libfaad2-0 flvtool2 ffmpeg lame
                aptitude full-upgrade

                clear
                wget -q 
http://victor.sartori.eti.br/openmeetings/swftools_0.8.1-2.1_i386.deb
                dpkg -i swftools_0.8.1-2.1_i386.deb
                wget -q http://victor.sartori.eti.br/openmeetings/red5.tar.bz2 
-O /tmp/red5.tar.bz2
                wget $SITE/$FILE
        fi
}

copy_files() {
        if [[ -z $INSTALL_HOME || -z $BASE_INSTALL ]]; then
                echo "The INSTALL_HOME and BASE_INSTALL variables, is required, 
you need to define where the OM will be installed. One tip: /opt/red5 in 
INSTALL_HOME and /opt in BASE_INSTALL"
                echo "The Install Script will be not completed."
                echo "Error code 4"             
                exit 4
        else
        
                unzip $FILE -d $BASE_INSTALL
                
                chown nobody $INSTALL_HOME -R
                chmod +x $INSTALL_HOME/*.sh
                chmod +x $INSTALL_HOME/webapps/openmeetings/jod/*.sh
                rm -rf $(pwd)/OM/
                tar -xjf /tmp/red5.tar.bz2 -C /etc/init.d
                update-rc.d red5 defaults
                update-rc.d openoffice defaults
        fi
}


database() {
        clear
        echo -n "Type the password will be used by user openmeetings at mysql: "
        read MYSQL_OM_USER_PASSWORD
        echo 
        echo -n "Type the MySQL root's password: "
        read ROOT_MYSQL
        
        if [[ -z $MYSQL_OM_USER_PASSWORD || -z $ROOT_MYSQL ]]; then
                echo "Blank passwords for MySQL root is not allowed."
                echo "Is not allowed typing a blank password for the user 
openmeetings at MySQL."
                echo "The Install Script will be not completed."
                echo "Error code 5"             
                exit 5
        else
                echo "CREATE USER openmeeti...@localhost;" |mysql -u root 
-p$ROOT_MYSQL
                echo "CREATE DATABASE openmeetings DEFAULT CHARACTER SET 
'utf8';" |mysql -u root -p$ROOT_MYSQL
                echo "GRANT ALL PRIVILEGES ON openmeetings.* TO 
'openmeetings'@'localhost' IDENTIFIED BY '$MYSQL_OM_USER_PASSWORD' WITH GRANT 
OPTION;" |mysql -u root -p$ROOT_MYSQL
                echo "FLUSH PRIVILEGES;" |mysql -u root -p$ROOT_MYSQL
        fi
}



mysql_connection() {
        
        if [ -f $INSTALL_HOME/webapps/openmeetings/conf/hibernate.cfg.xml ]; 
then
                rm $INSTALL_HOME/webapps/openmeetings/conf/hibernate.cfg.xml
        fi

        echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE hibernate-configuration PUBLIC \"-//Hibernate/Hibernate Configuration 
DTD 3.0//EN\" 
\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\";>

<!-- Generated file - Do not edit! -->

<hibernate-configuration>

        <!-- a SessionFactory instance listed as /jndi/name -->
        <session-factory>
                
                <!-- User  / Password -->
                <property name=\"connection.username\">openmeetings</property>
                <property 
name=\"connection.password\">$MYSQL_OM_USER_PASSWORD</property>
                
                <!-- Database Settings -->
                <property 
name=\"connection.driver_class\">com.mysql.jdbc.Driver</property>
                <!--  for performance reasons changed to MyISAM from 
org.hibernate.dialect.MySQLInnoDBDialect -->
                <property 
name=\"dialect\">org.hibernate.dialect.MySQLMyISAMDialect</property>
                <property 
name=\"connection.url\">jdbc:mysql://localhost/openmeetings?autoReconnect=true&amp;useUnicode=true&amp;createDatabaseIfNotExist=true&amp;characterEncoding=utf-8</property>
   
                
                <property name=\"hibernate.connection.CharSet\">utf8</property>
                <property 
name=\"hibernate.connection.characterEncoding\">utf8</property>
                <property 
name=\"hibernate.connection.useUnicode\">true</property>

                
                <!-- Database Scheme Auto Update -->
                <property name=\"hbm2ddl.auto\">update</property>               
        

                <!-- properties -->
                
                <property name=\"show_sql\">false</property>
                <property name=\"use_outer_join\">false</property>
                <property 
name=\"hibernate.query.factory_class\">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
        <property 
name=\"hibernate.connection.provider_class\">org.hibernate.connection.C3P0ConnectionProvider</property>
        <!--
        <property name=\"connection.provider_class 
\">org.hibernate.connection.C3P0ConnectionProvider</property>
         -->
        <property 
name=\"hibernate.cache.provider_class\">org.hibernate.cache.NoCacheProvider</property>
        <property name=\"hibernate.cache.use_query_cache\">false</property>
        <property 
name=\"hibernate.cache.use_second_level_cache\">false</property>
        <property name=\"hibernate.generate_statistics\">false</property>
        <property 
name=\"hibernate.cache.use_structured_entries\">false</property>


                <property name=\"c3p0.max_size\">20</property>
                <property name=\"c3p0.min_size\">2</property>
        <property name=\"c3p0.idle_test_period\">100</property>
                <property name=\"c3p0.max_statements\">100</property>
                <property name=\"c3p0.timeout\">100</property>

                <!-- mapping files -->
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/adresses/Adresses.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/adresses/States.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Configuration.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/ErrorType.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/ErrorValues.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Naviglobal.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Navimain.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Navisub.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/SOAPLogin.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Sessiondata.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/Appointment.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/AppointmentCategory.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/AppointmentReminderTyps.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/MeetingMember.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/domain/Organisation.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/domain/Organisation_Users.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecording.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecordingLog.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecordingMetaData.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecordingMetaDelta.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/invitation/Invitations.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/lang/FieldLanguage.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/lang/Fieldlanguagesvalues.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/lang/Fieldvalues.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/logs/ConferenceLog.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/logs/ConferenceLogType.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/ChatvaluesEvent.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/Recording.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RecordingClient.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RecordingConversionJob.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RoomClient.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RoomRecording.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RoomStream.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/WhiteBoardEvent.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/RoomModerators.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/RoomTypes.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/Rooms.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/Rooms_Organisation.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Salutations.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/UserSipData.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Userdata.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Usergroups.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Userlevel.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Users.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Users_Usergroups.hbm.xml\"/>
    
        </session-factory>

</hibernate-configuration>" >> 
$INSTALL_HOME/webapps/openmeetings/conf/hibernate.cfg.xml
}


start_services() {
/etc/init.d/openoffice start
sleep 5
/etc/init.d/red5 start
sleep 2
clear
echo "Done!! open the website at your browser: http://$(ifconfig eth0 |grep 
"inet addr:" |cut -d : -f 2 |cut -f1 -d" "):5080/openmeetings/install"
}

check() {
if [ "$(id -u)" -ne "0" ]; then
        echo "You don't have root power!"
        exit 1
else

        if [ -f /etc/debian_version ]; then
                if [ $(cat /etc/debian_version| cut -d . -f 1) == 5 ]; then
                        menu
                else
                        VERSION=$(cat /etc/debian_version)
                        echo "You are not using Debian Lenny 5"
                        echo "Your version is: "$VERSION
                        echo "Error code 1"                     
                        exit 1
                fi
        else
                echo "You are not using Debian!"
                echo "Error code 6"             
                exit 6
        fi
fi
}
check

Reply via email to