Skip to content

Instantly share code, notes, and snippets.

@neilmartin83
Created November 16, 2016 21:56
Show Gist options
  • Select an option

  • Save neilmartin83/bd96fdf3f78f2c4f250455f260ddaa24 to your computer and use it in GitHub Desktop.

Select an option

Save neilmartin83/bd96fdf3f78f2c4f250455f260ddaa24 to your computer and use it in GitHub Desktop.
#!/bin/sh
## Script to detect and enumerate attached iLok Serial
SERIAL=`system_profiler SPUSBDataType | grep -B 5 -i ': iLok' | grep 'Serial' | cut -f 2 -d ":" | sed -e "s/ //"`
#SERIAL=`system_profiler SPUSBDataType | grep -B 5 -i ': iLok' | grep 'Serial'`
if [[ "$SERIAL" == "" ]]
then
echo '<result>'No iLok Connected'</result>'
else
echo '<result>'$SERIAL'</result>'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment