Need Script

Hi Experts,
We have a application on Linux server (RHEL/CentOs), frequently we have to install & uninstall that application from a long process.  I need a script for that process. Please suggest.

Installation Process:-

[root@119 ~]# cd Linux_811
[root@119 Linux_811]# ./8.0.11_Setup.sh
------------------------------Welcome to ET Installer------------------------------
It is recommended that, ET Installation should be done using "root" login.
Also ET_8.0.11_SetupFiles.zip and the installer script should be kept in the same directory.
The L2llowing ET Installation will allow only ***Single Client connectivity to ET***.
Continue with Installation/Upgradation [(y)es/(n)o] ? y
Please Enter your Broker ID : 8877


        *********************** INSTALL ET FOR *************************
         1. Login 1 (L1)
         2. Login 2 (L2)
         3. Login 3 (L3)
         0. Exit Installation
        ******************************************************************
 Enter your choice      1
Select additional login? [(y)es/(n)o/(q)uit]      y

        *********************** INSTALL ET FOR *************************
         2. Login 2 (L2)
         3. Login 3 (L3)
         0. Exit Installation
        ******************************************************************
 Enter your choice      2
Select additional login? [(y)es/(n)o/(q)uit]      n
Default destination directory L2r ET installation: [/usr/bin]
Press Y to continue, N to select another path L2r ET installation and Q to quit installation : y
ET will be installed at : [/usr/bin/ET]
Installing TAP [Ver.8.0.11] for Login 1 (L1) ->
Member ID: [8877]
Details of the Components installed\upgraded successfully..
ET Monitoring Service installed.
Details of the Components installed\upgraded successfully..
ET Repository Management installed.
ET Configuration and Monitoring System installed.
Data Gathering Utility installed.
Press enter key to continue.

Starting ET Agent [1.0RC6] with config file [../CONFIG/ET_agent.ini]
ET  L1 has been installed successfully on your machine.
Kindly configure ET using ET Configuration and Monitoring System [ETCMS].
-------------------------------------Login 1 END----------------------------------------

Installing ET [Ver.8.0.11] Login 2 (L2) ->
Member ID: [8877]

./agent_monitoring_service.sh: line 58:  3656 Killed                  ./ET_agent -c ../CONFIG/ET_agent.ini
ET  L2 has been installed successfully on your machine.
Kindly configure ET using ET Configuration and Monitoring System [ETCMS].
-------------------------------------Login 2 END----------------------------------------


Installation is in progress ........Press enter key to continue.

Starting ET Agent [1.0RC6] with config file [../CONFIG/ET_agent.ini]
..
Installation Completed.
[root@119 Linux_811]#


Unstallation Process:-

[root@119 ~]# cd /usr/bin/ET/8877/
[root@119 8877]# ./uninstall.sh
------------------------------Welcome to ET Uninstaller------------------------------
It is recommended that, ET Uninstallation should be done using "root" login.
Member ID: [8877]
**************************************
Select the market to be uninstalled

1. Login 1
2. Login 2
A. All Login
Q. Quit
**************************************
Please select one of the above: A

Are you sure you want to proceed uninstalling ET for All Markets(Y/N): Y

Uninstalling ET for All the Markets...
ET was completely removed from your computer.
LOGS and REPOSITORY folders have to be deleted manually.
-----------------------------------------END-----------------------------------------
[root@119 8877]# cd /usr/bin/
[root@119 bin]# rm -rf ET/
[root@119 bin]# cd
[root@119 ~]#
Enhance TechnologyFounderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johnsoneSenior Oracle DBACommented:
Look into scripting with expect.  It is pretty much designed for this type of scripting.  It has the ability to wait for prompts and respond to them.
1
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
As johnsone suggested, Expect is likely the correct tool for this.

You could run your script using script </dev/stdin or some tty, however your system is setup.

Sometimes this works + many problems arise when your installation script changes in subtle ways.

Expect can be scripted as a state machine, where anytime new questions appear or expected questions disappear or questions rearrange, you can easily script these changes to be caught + the script to bail out with sensible messaging.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Enhance TechnologyFounderAuthor Commented:
Thanking You
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.