We are trying to deploy the Forescout connector on a Mac machine through a Jamf policy, which requires us to deploy a .pkg file, a script, and most importantly, the folder containing the Forescout agent on the desktop. This folder includes the launch daemon and a few other commands. However, we are encountering errors and are not able to successfully deploy the folder. Can you advise us on how to proceed?
Solved
Issue with deploying Forescout connector on Mac via Jamf policy
Best answer by AJPinto
I found it better to just use a script and get the Forescout .tar with curl and do everything on the Mac.
#!/bin/sh
####################################################################################################
#*
####################################################################################################
#Downloading OSX Update Package to /tmp on the host
curl -o {path where you want to save the dowload}.tgz http://{source file URL}; sleep 3
#Extracting update.tgz to /tmp
tar -zxvf {path where you want to save the download}.tgz -C {path where you want to uncompress the tar}; sleep 3
#Installing SecureConnector as a Daemon/Dissolvable w/ visible/invisible menu bar icon
sudo sh {path where you want to save the download}/Update.sh -t daemon -v 1; sleep 3
#Checking/Starting processes in case they did not start on install
daemon_pid=`ps auxww | grep -v grep | egrep "ForeScout SecureConnector.-daemon" | awk '{print $2}'`
agent_pid=`ps auxww | grep -v grep | egrep "ForeScout SecureConnector.-agent" | awk '{print $2}'`
daemon_plist=/Library/LaunchDaemons/com.forescout.secureconnector.daemon.plist
agent_plist=/Library/LaunchAgents/com.forescout.secureconnector.agent.plist
if [[ -z "$daemon_pid" && -z "$agent_pid" ]]; then
#Starting Daemon process
launchctl unload $daemon_plist
launchctl load $daemon_plist
#Starting GUI process
launchctl unload $agent_plist
launchctl load $agent_plist
elif [[ ! -z "$daemon_pid" && -z "$agent_pid" ]]; then
#Starting GUI process
launchctl unload $agent_plist
launchctl load $agent_plist
fi
#Clean-up a little
sudo rm -rf {path where you want to save the download}.tgz {path where you want to uncompress the tar}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
