Shell Script for re-installation of open office


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script for re-installation of open office
# 1  
Old 02-16-2018
Shell Script for re-installation of open office

Below is the script for open office automatic re-installation, there are different versions on different servers the below script will check the version of the
openoffice and will reinstall the same version(downloading for httpd server) the below code looks lengthy can we make it short


Code:
#!/bin/bash
# Bash Menu for OPENOFFICE Installation
 
rpm -qa | egrep "^ooo|openoffice" | grep 3.3.0-9567
if [ $? -eq 0 ]
then
echo "############this is a Server version openoffice3.3.0#################"
sleep 3
rpm -qa | egrep "^ooo|openoffice" | xargs sudo rpm -e
cd /opt
rm -rf /opt/openoffice.org3 /opt/openoffice.org  /opt/OOO330_m20_native_packed-1_en-US.9567
sleep 5
#wget http://192.168.64.13/OOo_3.3.0_Linux...E_en-US.tar.gz
tar -xvf OOo_3.3.0_Linux_x86-64_install-rpm-wJRE_en-US.tar.gz
cd /opt/OOO330_m20_native_packed-1_en-US.9567/RPMS
rm -rf jre*
rpm -ivh *.rpm
sleep 3
cd desktop-integration/
rpm -ivh openoffice.org3.3-redhat-menus-3.3-9556.noarch.rpm
echo "####################openoffice3.3.0 installed####################"
rm -rf /opt/OOO330_m20_native_packed-1_en-US.9567
exit 0
fi
rpm -qa | egrep "^ooo|openoffice" | grep 3.4.1-9593
if [ $? -eq 0 ]
then
echo "##################this is a Server version openoffice3.4.1####################"
sleep 3
rpm -qa | egrep "^ooo|openoffice" | xargs sudo rpm -e
cd /opt 
rm -rf /opt/en-US/ /opt/openoffice.org /opt/openoffice.org3/
sleep 3
#wget  http://192.168.64.13/Apache_OpenOffi...m_en-US.tar.gz
tar -xvf Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_en-US.tar.gz
cd en-US/RPMS
rpm -ivh *.rpm
sleep 3
cd desktop-integration/
rpm -ivh openoffice.org3.4-redhat-menus-3.4-9593.noarch.rpm
echo "#####################openoffice3.4.1 installed#####################"
rm -rf /opt/en-US/
exit 0
fi 
rpm -qa | egrep "^ooo|openoffice" | grep 4.0.0-9702
if [ $? -eq 0 ]
then
echo "################################this is a Server version openoffice4.0.0##################"
sleep 3
rpm -qa | egrep "^ooo|openoffice" | xargs sudo rpm -e
cd /opt
rm -rf /opt/en-US/  /opt/openoffice4/
sleep 3
#wget http://192.168.64.13/Apache_OpenOffi...m_en-US.tar.gz
tar -xvf Apache_OpenOffice_4.0.0_Linux_x86-64_install-rpm_en-US.tar.gz
cd en-US/RPMS
rpm -ivh *.rpm
sleep 3
cd desktop-integration/
rpm -ivh openoffice4.0-redhat-menus-4.0-9702.noarch.rpm
echo "#############openoffice4.0.0 installed##############"
rm -rf /opt/en-US/
exit 0
fi
rpm -qa | egrep "^ooo|openoffice"| grep 4.1.0-9764
if [ $? -eq 0 ]
then
echo "##################this is a Server version openoffice4.1.0####################"
sleep 5
rpm -qa | egrep "^ooo|openoffice" | xargs sudo rpm -e 
cd /opt
rm -rf /opt/en-US/  /opt/openoffice4/
sleep 3
#wget http://192.168.64.13/Apache_OpenOffi...m_en-US.tar.gz
tar -xvf Apache_OpenOffice_4.1.0_Linux_x86-64_install-rpm_en-US.tar.gz
cd en-US/RPMS
rpm -ivh *.rpm
sleep 3
cd desktop-integration/
rpm -ivh openoffice4.1-redhat-menus-4.1-9764.noarch.rpm
echo "######################openoffice4.1.0 installed############################"
rm -rf /opt/en-US/
exit 0
fi
rpm -qa | egrep "^ooo|openoffice"| grep 4.1.1-9775
if [ $? -eq 0 ]
then
echo "####################this is a Server version openoffice4.1.1################"
sleep 5
rpm -qa | egrep "^ooo|openoffice" | xargs sudo rpm -e 
cd /opt
rm -rf /opt/en-US/  /opt/openoffice4/
sleep 3
#wget http://192.168.64.13/Apache_OpenOffi...m_en-US.tar.gz
tar -xvf Apache_OpenOffice_4.1.1_Linux_x86-64_install-rpm_en-US.tar.gz
cd en-US/RPMS
rpm -ivh *.rpm
sleep 3
cd desktop-integration/
rpm -ivh openoffice4.1.1-redhat-menus-4.1.1-9775.noarch.rpm
echo "###################openoffice4.1.1 installed###############"
rm -rf /opt/en-US/
exit 0
fi
exit

# 2  
Old 02-19-2018
are you having problems with this script?
are you having performance issues?
what do you mean by making the script short?

explain your problem clearly..
# 3  
Old 02-20-2018
This looks little lenghty thinking can't this be made short using case etc.
# 4  
Old 02-20-2018
Hello James,
you can re-write this into a function by passing the open office version number as an argument to it and re-use it for any version.
we would like to encourage you to re-write the script and let us know, if you face any problems on the event of re-writing.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Star/Libre/Open/???-Office for Solaris 11.2 ?

It's been a few years since this topic was last asked and answered.. curious whether anyone knows if the landscape has improved? looking for a more modern release of OpenOffice / LibreOffice / etc than the OOo-3.3 version mentioned in earlier posts from 2012. Would prefer not to compile from... (1 Reply)
Discussion started by: Yeaboem
1 Replies

2. Linux

Office installation on Linux without root access

Need Assistance in finding office open source for REDHAT linux. Need to be compiled as non-root user . If possible I also need instructions for installation. (6 Replies)
Discussion started by: ajayram_arya
6 Replies

3. Red Hat

Open office recommendation

NEED recommendation and assistance on getting open office source installation on redhat 6 linux . I want an open office on redhat 6 linux server . Dont have root access Can someone guide me ? (0 Replies)
Discussion started by: ajayram_arya
0 Replies

4. Emergency UNIX and Linux Support

Error when trying to start open office

Hi all I am receivng following error while running openoffice on linux system Please suggest and linux comman which can remove this error: (I) x.org loaded video driver of... (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so (==) Depth 24 pixmap format is 32 bpp (III) ... (2 Replies)
Discussion started by: manigrover
2 Replies

5. Shell Programming and Scripting

generating report in Excel(Open office) using shell scripting

Hello All, I need to execute around 15 queries after which all data should come in Excel format. Executing 15 queries is not a problem. Problem is how to present/put data in excel. kindly suggest me how to start, what to study or what should i do. thanks, (1 Reply)
Discussion started by: shubham8787
1 Replies

6. UNIX for Advanced & Expert Users

Finger command not showing Office, Office Phone from /etc/passwd

Not sure if this is the best place to post, but at this point my question seems to be an advanced topic. I'm curious why it is that the "office phone" column of finger does not seem to report anything even when data is entered in the GECOS field of /etc/passwd. I am using Ubuntu 8.10, kernel... (1 Reply)
Discussion started by: gratuitous_arp
1 Replies

7. Red Hat

how can i get open office package for Redhat Linux 5.0

Dear Team, Any body who have idea to down load the open office package for Redhat linux 5.0. Please send me the URL. so that i can easily down load from net. (2 Replies)
Discussion started by: sahu.tapan
2 Replies

8. UNIX for Advanced & Expert Users

Shell Script to Automate Package Installation

Hi, I have been asked to automate the package installation through shell script. I have 10 packages to be installed and in that 4 packages requires additional DB information(Host Name, Credentials etc) to be passed and for remaining 6 packages i need to provide the "Yes" - "No" . I have... (2 Replies)
Discussion started by: muhilan.r
2 Replies

9. UNIX for Dummies Questions & Answers

.ttf font installation in open office

How can we install new .ttf (Arial,Times new roman etc,) font in linux open office.org? (1 Reply)
Discussion started by: pcsaji
1 Replies
Login or Register to Ask a Question