Script Parameter for Set Distribution Point

ttruong
New Contributor

Scripts in Casper has predefined variables for $1, $2, $3 where

$1 = Mount point of the target drive

$2 = Computer name

$3 = Username

In my script, I want to curl from the distribution point (set during Casper Imaging).
Is there a predefined variable for this? If not, how can I capture it in a variable?

Thank you,

TT

7 REPLIES 7

bentoms
Release Candidate Programs Tester

@ttruong can you give more information on what & or why?

ttruong
New Contributor

This application has a package with an add-on file. I need to run the package installer within a directory that includes the add-on file for the installation to be succesful. In my script I'm curling a tar file, extracting the tar into tmp, cd into the directory, and run installer -pkg.

The problem is, we have multiple sites and I don't want to have multiple scripts, for each http:// distribution point for each site. I'm hoping there's a way to capture the distribution point into a variable, based on the selection during Casper imaging. I'm aware I can just bundle everything into a package, but I want to make this work with the given script.

Here's the gist of the script:

PAK=sc_tmsminstall.tar.gz
PAKEXT=tmsminstall
SERV1=sc-mmserver3

downloads installer

echo "Downloading TrendMicro from Distribution Server..."
cd /tmp
curl -O -k http://$SERV1/CasperShare/Packages/$PAK

Unzip and install

echo "Extracting and Installing..."
tar -xzvf $PAK
cd $PAKEXT
installer -pkg $PAKEXT.pkg -target /

Removes installer files

echo "Removing installer files"
rm -rf /tmp/$PAKEXT
rm /tmp/$PAK

bentoms
Release Candidate Programs Tester

@ttruong Hmm.. I'd go with a PKG & let the JSS handle the logic of which DP to install it from tbh.

I know you've discounted that, but why not let the JSS do the heavy lifting?

ttruong
New Contributor

Even with a PKG, I would need to write installer scripts for each. Anyway, if there's no way of extracting the selected Distriubution Point, I have no choice.

bentoms
Release Candidate Programs Tester

@ttruong looking at the above script. All you need is the PKG on the DP.

Then via the JSS cache that PKG locally & install it.

I'm still missing the need to script it off of the DP.

ttruong
New Contributor

I need to run the installer with the add-on file in the same directory. How would I do that using JSS cache?

bentoms
Release Candidate Programs Tester

@ttruong Sorry I didn't see that in the above.

Hmm, what I've done for Sophos is create a DMG of the folder that has the installer & needed additional files.

That's "installed" to a location, then a script runs the installer & tidies up.