Shell Programming and Scripting

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Help with an install script

👤 Login to reply

 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-26-2008
dhs23 dhs23 is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 11 April 2008, 11:30 AM EDT
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Help with an install script

Hello all.

I have a script I have written which runs a silent install of Mcafee AV and ePO for Mac OS X.

The issue I am wondering about is what happens when the script launches the installers.

The script is fairly simple, and just invokes the shell installer for each app:

Code:
#! /bin/sh

# script to install Mcafee VirusScan and ePolicy Orchestrator 3.6

# cd to temp install directory

cd /tmp/Mcafee_Install/

# Launch AV installer

installer -pkg VirusScan.pkg -target /

# Sleep while AV installer completes install

sleep 60

# Next installs ePolicy Orchestrator

./cmdinstall 10.44.112.40:82

# Sleep while ePO installer completes.

sleep 120

# Reboot to complete install.

reboot

You'll notice that I have told the script to sleep after launching the installer for each app. My question is: "Is this necessary?"

My thinking was that once the script has launched the installer, that's a separate process and as far as I am aware, my script would simply continue with the second install immediately. I don't want both apps installing at the same time, or the system rebooting halfway through the second install, so I told the script to sleep for a moment, to give the installs a chance to complete.

Am I being silly here? Are the sleep commands necessary? Will the script wait for the install to complete before launching the next install, or rebooting in the case of the second install?

Any thoughts?

Cheers
Sponsored Links
    #2  
Old 02-28-2008
Smiling Dragon's Unix or Linux Image
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
 
Join Date: Nov 2007
Last Activity: 27 July 2017, 4:23 PM EDT
Location: New Zealand
Posts: 1,060
Thanks: 25
Thanked 29 Times in 28 Posts
If you were to run the install scripts manually, do they immediatly exit but keep working in the background?

If so, then you'll need to find a way to wait for them to finish (a sleep is dangerous as you don't know how quickly they will run). I'd suggest looking for the process that the install script triggers in the process table and looping round waiting for it to vanish.

If it doesn't run in the background, then yes, the sleeps are totally unnecessary.
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help With Install Script scotbuff Shell Programming and Scripting 0 03-22-2010 10:05 AM
Install Script ice2257 Shell Programming and Scripting 6 12-15-2009 11:29 PM
install macbook pro fedora10 ???((<<if can install, how to install? >> )) kzBSD Linux 0 03-18-2009 02:57 AM
Script to install jdk eamani_sun Shell Programming and Scripting 6 12-06-2008 01:04 PM
Install script potro Shell Programming and Scripting 2 06-20-2008 07:46 AM



All times are GMT -4. The time now is 07:14 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?