Skip to main content

I need a script to check that Box Sync is running in the background. I have tried adding a few as extension attributes but they don't seem to work. I just need a report to see if the process is actually running or not.



Any ideas?

How about something based on:



http://stackoverflow.com/questions/1821886/check-if-mac-process-is-running-using-bash-by-process-name


@Brianmarum



As a start, this works fine as an extension attribute:



#!/bin/bash

box_status=$(ps aux | grep "Box Sync Monitor" | grep -v "grep")

if [ ! -z "$box_status" ]; then
echo "<result>Running</result>"
else
echo "<result>Not Running</result>"
fi

This worked perfectly. Thanks a million!


Reply