Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Last active August 29, 2015 14:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/2b8cddaa22b2f537119f to your computer and use it in GitHub Desktop.
Save rtrouton/2b8cddaa22b2f537119f to your computer and use it in GitHub Desktop.
Junos Pulse postinstall
#!/bin/bash
# Determine working directory
install_dir=`dirname $0`
#
# Installing Junos Pulse
#
# Specify location of the Junos Pulse disk image
TOOLS=$install_dir/"JunosPulse.dmg"
# Specify location of the Junos Pulse configuration file
VPN_CONFIG_FILE=$install_dir/"Default.jnprpreconfig"
# Specify a /tmp/junospulse.XXXX mountpoint for the disk image
TMPMOUNT=`/usr/bin/mktemp -d /tmp/junospulse.XXXX`
# Mount the latest Junos Pulse disk image to the /tmp/junospulse.XXXX mountpoint
hdiutil attach "$TOOLS" -mountpoint "$TMPMOUNT" -nobrowse -noverify -noautoopen
# Install Junos Pulse
/usr/sbin/installer -dumplog -verbose -pkg "$(/usr/bin/find $TMPMOUNT -maxdepth 1 \( -iname \*\.pkg -o -iname \*\.mpkg \))" -target "$3"
#
# Applying VPN configuration file
#
if [[ -d "$3/Applications/Junos Pulse.app" ]]; then
echo "Junos Pulse VPN Client Installed"
"$3/Applications/Junos Pulse.app/Contents/Plugins/JamUI/jamCommand" -importFile "$VPN_CONFIG_FILE"
echo "VPN Configuration Installed"
else
echo "Pulse Client Not Installed"
fi
#
# Clean-up
#
# Unmount the Junos Pulse disk image
/usr/bin/hdiutil detach "$TMPMOUNT"
# Remove the /tmp/junospulse.XXXX mountpoint
/bin/rm -rf "$TMPMOUNT"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment