Posted on 02-08-2021 11:44 PM
Hey, So, after lots of tests and struggling with new ways to migrate DMG file to PKG I found that none of them really works and the agent never starts and works properly...
I found this script (don't remember where) and this solved my issue!
```
curl -o /tmp/update.tgz http://YOUR_SERVER_NAME_OR_IP/SC_packages/update.tgz; sleep 3
tar -zxvf /tmp/update.tgz -C /tmp; sleep 3
sudo -S /tmp/Update/Update.sh -t daemon -v 1; sleep 3
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
elif [[ ! -z "$daemon_pid" && -z "$agent_pid" ]]; then #Starting GUI process launchctl unload $agent_plist launchctl load $agent_plist
fi
sudo rm -rf /tmp/update.tgz /tmp/Update/
``
I hope this will help the other guys that having the same issue as I had :)
Cheers!