Visit The New, Modern Unix Linux Community

Manually Installing McAfee AV agent

Thread Tools Search this Thread
Operating Systems OS X (Apple) Manually Installing McAfee AV agent
# 1  
Manually Installing McAfee AV agent

I've tried a few things to manually push out a script as a test from one of my primary machines to a test machine. I have a McAfee agent that I just obtained from McAfee, and I'm simply trying to remember what I did via terminal to push it out from my primary machine. Well, I finally figured it out. But now I want to execute the script on the test machine from the primary machine, so that I can install it.

What I'm trying to do is just create a script or use a command that will allow me to push out my shell script (which is on my desktop), out to the test machine, then execute the shell script on the test machine to install itself.

* Let me add that, I've tried on a few occasions to run: chmod +x, and I never got passed an error that stated: chmod: No such file or directory
what am I doing wrong here?

Any help would be appreciated.


Last edited by unimachead; 04-22-2016 at 06:01 PM..
# 2  
Sure, and thanks for the assistance. I'll insert a little of the code here:
###getopt for command line arguments.
###Handle the following
### -i install, rpm ivh
### -u upgrade, rpm Uvh  )
### -b upgrade but no server info
### -c cloud config path (option for internal usage in bootstrap)
### -h help

umask 022


    echo "Usage: $command [-i|-u|-b|-h ]"
    echo "-i : fresh install "
    echo "-u : upgrade install"
    echo "-b :Upgrade Agent only , no server info will be updated"
    echo "-h : show this help"
    echo ""

user=`id | cut -d'=' -f2 | cut -d\( -f1`
if [ $user -ne 0 ]; then
    echo "This package needs root authentication to install."
    exit 1

###BZ 392336 Bail out if NWA exists
if [ -d /Library/NETAepoagt ];then
	echo "Detected presence of previous agent in /Library/NETAepoagt. Installation cannot continue."
	exit 1

###Validation: No args, go away
if [ $# -eq 0 ]; then 
    exit 1


##First get the options
while getopts e:ic:ubh: opt
  do	case "$opt" in
      i)  install="yes";;
      c)  cloud="$OPTARG";;
      u)  upgrade="yes";;
      b) upgrade="yes";;
      h)  usage
	  exit 0;;
      [?])	usage
      exit 1;;
value=`expr $OPTIND - 1`
shift $value


###Cannot have install and upgrade together
if [ ! -z "$install" ] && [ ! -z "$upgrade" ];then
    echo You cannot specify install and upgrade at the same time
    exit 1

##Cannot have "neither install, nor upgrade"
if [  -z "$install" ] && [  -z "$upgrade" ];then
    echo "Neither install nor upgrade has been specified in the options"
    exit 1

if [ -e /Volumes/MFECMA ];then
    echo /Volumes/MFECMA already exists.The agent disk image cannot be mounted
    echo Please move or rename /Volumes/MFECMA and then rerun this setup
    exit 1

###Okay, now that everything has been checked, its time to get going
##First we need to extract everything to a temp location, 
##and then unzip it to the final destination
if [ ! -z "$cloud" ];then
	#For Agent installation through bootstrap.
	echo "Agent installation through bootstrap."
	if [ ! -d "$cloud" ];then 
		echo "Cloud config path doesn't exist($cloud)."
		exit 1
	#For On-Prem install
	temp_directory=`mktemp -d mfeXXXXXX`
	if [ -f /etc/cma.d/bootstrap.xml ];then 
	    rm -rf /etc/cma.d/bootstrap.xml

	if [ -z "$directory" ];then 

	if [ -f "$directory" ];then 
	    echo Output destination specified is a file which laready exists. Cannot overwrite
	    rm -rf "$temp_directory"
	    exit 1

	if [ ! -e "$directory" ];then 
	    mkdir -p "$directory"

if [ -e "$temp_directory" ] ;then 
    ###installer  has checks for disk space, and so I wont bother about it.
    ###unzip will also complain is there isnt enough space for the extracted file
    ###So, all I care about is to have enough space for the zip itself.
    ###Since the zip is appended to this file itself, it would never be larger that 
    ###this sfx itself.So havin enough space in $temp_dir to hold the sfx is good enough
if [ -z "$cloud" ];then

    required_space=`stat -f %z "$command"`
    required_space=`expr $required_space \* 2`
    echo space required to copy archive is $required_space bytes
    available_space=`df -k $temp_directory | tail -n -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
    #convert the kb to bytes
    available_space=`expr $available_space \* 1024`
    echo space available at $temp_directory is $available_space bytes
    if [ $required_space -gt $available_space ];then
	echo Not enough space to extract contents
	rm -rf $temp_directory
	exit 1
    echo "extracting archive to $directory... please wait"
    SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' "$0"`
# take the archive portion of this file and pipe it to unzip
    tail +$SKIP "$command" > "$temp_directory"/payload

    nblocks=`expr $unzip_exe_size / $block_size`
    remainder=`expr $unzip_exe_size % $block_size`
    if [ 0 != $remainder ];then
	nblocks=`expr $nblocks + 1`
    dd if="$temp_directory"/payload of="$temp_directory"/unz bs=$block_size count=$nblocks
    dd if="$temp_directory"/payload of="$temp_directory"/ bs=$block_size skip=$nblocks
    chmod +x "$temp_directory"/unz
#    /bin/sh "$temp_directory"/unz -j -o $"$temp_directory"/ -d "$directory"
    unzip -j -o $"$temp_directory"/ -d "$directory"
    rm -rf "$temp_directory"/
    rm -rf "$temp_directory"/unz
if [ -n "$install" ] || [ -n "$upgrade" ];then
	if [ "$updateserverinfo" = "yes" ] ; then
    		mkdir -p "$keydata_dir" 
    		if [ $returncode -ne 0 ] ; then 
			echo "Failed to create keydata directory.exiting"
			exit 1 
    		cp -f "$directory"/sitelist.xml "$keydata_dir"/SiteList.xml
    		cp -f "$directory"/srpubkey.bin "$keydata_dir"
    		cp -f "$directory"/reqseckey.bin "$keydata_dir"
    		cp -f "$directory"/sr2048pubkey.bin "$keydata_dir"
    		cp -f "$directory"/req2048seckey.bin "$keydata_dir"
    		cp -f "$directory"/agentfipsmode "$keydata_dir"/agentfipsmode
			cp -f "$directory"/RepoKeys.ini "$keydata_dir"/RepoKeys.ini
    		if [ ! -f "$keydata_dir"/SiteList.xml ] || [ ! -f "$keydata_dir"/srpubkey.bin ] || [ ! -f "$keydata_dir"/reqseckey.bin ] || [ ! -f "$keydata_dir"/sr2048pubkey.bin ] || [ ! -f "$keydata_dir"/req2048seckey.bin ];then
    			echo "Could not find key data files. Installation cannot continue"
        		rm -rf "$keydata_dir"
        		exit 1

   hdiutil attach -nobrowse "$directory/MFEcma.dmg"

####Now do the actual install/ upgrade stuff
####The actual operations for copying the reqseckey and other files should already be there in the installer
if [ -z "$extract" ];then
    cd "/Volumes/MFECMA"
    echo "IsLegacyEPO:N" > /etc/mainstall.config
    echo "ConfigDirPath:/Volumes/MFECMA" >> /etc/mainstall.config
    echo "StartService:Y" >> /etc/mainstall.config
	pltvrsn=`/usr/bin/sw_vers | grep ProductVersion | cut -d: -f2`
	majvrsn=`echo $pltvrsn | cut -d. -f1`
	minvrsn=`echo $pltvrsn | cut -d. -f2`

	if [ -f /Library/McAfee/cma/bin/msaconfig ];then
	if (($majvrsn>=10 && $minvrsn>=6 && $flag)); then
		sudo /usr/sbin/pkgutil --forget comp.nai.cmamac > /dev/null 2>&1 
    sudo /usr/sbin/installer -pkg cma.pkg -target "/" 
    sleep 5
    cd "$mypwd"
    hdiutil detach /Volumes/MFECMA
    rm -rf /etc/mainstall.config
    hdiutil detach /Volumes/MFECMA

if [ -z "$cloud" ];then
	rm -rf "$temp_directory"

if [ $returncode -ne 0 ];then
	rm -rf "$keydata_dir"
        exit 1

if [ -d "$keydata_dir" ] ; then
	rm -rf "$keydata_dir"
exit 0

# 3  
Figured out what needed to happen, and this is the solution below--

Target the area you want to place the script in and create a directory for the script to live:
mkdir -p /Library/Application\ Support/McAfee

Next, install the McAfee script from wherever it resides

Make the file into an executable:
chmod +x /Library/Application\ Support/McAffee/

Activate the script:
/Library/Application\ Support/ -i

Last edited by Don Cragun; 06-06-2016 at 02:53 AM.. Reason: Add CODE tags.
# 4  
Thank you for sharing what you have learned...

Shouldn't the code to activate your script include the McAffee component in the pathname of your executable?:
/Library/Application\ Support/McAffee/ -i

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #312
Difficulty: Easy
Linus Torvalds created Unix and Git.
True or False?

8 More Discussions You Might Find Interesting

1. Red Hat

Issue w/manually installing OpenSSL 1.0.1j

My Redhat Enterprise 5 system is vulnerable to POODLE and there does not seem to be a Redhat fix coming down the pipe. So I have downloaded OpenSSL 1.0.1j from source and built it. My question is ho do I make sure the Apache and Tomcat use the1.0.1j version and not the distro version. Thanks,... (0 Replies)
Discussion started by: caspersgrin
0 Replies

2. Solaris

Create rpool manually

Hi All; My server's root partition was encapsulated with VxVM, I try to convert it to ZFS. I successfully de-encapsulated root. Now I try to mirror 2 root disks using ZFS. But I receive following error: # zpool create rpool mirror c0t0d0s0 c0t1d0s0 invalid vdev specification use '-f' to... (6 Replies)
Discussion started by: reseki
6 Replies

3. Shell Programming and Scripting

Bash - manually cp-r

hi guys i want a script manually copy all directories and files. Dont want to use cp-r, cp-R or any variant. How to do this, the piece of code i need is commented in the script Code: #!bin/bash IFS=$'\n' if test "$1" = "" then wd=pwd else wd=$1 fi for file in... (1 Reply)
Discussion started by: Wolverine89
1 Replies

4. Shell Programming and Scripting

Bash - manually cp-r

hi guys i want a script manually copy all directories and files. Dont want to use cp-r, cp-R or any variant. How to do this, the piece of code i need is commented in the script #!bin/bash IFS=$'\n' if test "$1" = "" then wd=pwd else wd=$1 fi for file in $(find $1)... (0 Replies)
Discussion started by: Wolverine89
0 Replies

5. Programming

Installing perl modules manually

I am trying to install a perl module using a tar file and am having trouble doing so. I see that on the system there are two version of perl installed. /usr/bin/perl -v /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int ... (0 Replies)
Discussion started by: metallica1973
0 Replies

6. Linux

Installing Firefox and now ended up installing latest glibc

Hi all, I wanted to install the latest version of firefox 2 but it seems when I attempt to install it, it seems to be saying it is looking for c libraries version 2.3? I believe I currently have an older version of the c libraries. I am currently running Sun's JDS Linux 2003. My Mozilla web... (1 Reply)
Discussion started by: scriptingmani
1 Replies

7. Solaris

FYI: McAfee VirusScan 4.40 for UNIX engine broken

FYI: As of 5/25, all dat updates are failing when uvscan v4.40 is run. McAfee has discontinued support for v4.40 in Jan 07. You will need to upgrade to v5.10 to support the new dat updates. (0 Replies)
Discussion started by: mhm4
0 Replies

8. Solaris

Installing SNMP Agent on Solaris Systems

Hi, I am trying to apply the steps in the below link: but I couldn't continue with the step number 2 ... what is the path of C compiler. export PATH=<gcc path>:$PATH ... (3 Replies)
Discussion started by: adel8483
3 Replies

Featured Tech Videos