-
-
Save rtrouton/2b8cddaa22b2f537119f to your computer and use it in GitHub Desktop.
Junos Pulse postinstall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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