Thursday, July 28, 2011

Lion PreCheck script for DeployStudio

Just wanted to share a small script that checks if the computer is 64 bit. Perfect to add to your workflow in DeployStudio as a first automated step. If the computer is 64 bit, it just continues with the workflow, if not, the workflow will get aborted.

#!/bin/bash

ARCH=$(ioreg -l -p IODeviceTree | grep firmware-abi | awk -F'"' '{print $4}')

if [ "$ARCH" = "EFI64" ]; then
echo "LION PRECHECK - This computer can run Lion"
echo "LION PRECHECK - Architecture: $ARCH"
exit 0
else
echo "LION PRECHECK - This computer CANNOT run Lion"
echo "LION PRECHECK - Architecture: $ARCH"
exit 1
fi

No comments: