Skip to content

Instantly share code, notes, and snippets.

@okanon
Last active Jul 24, 2018
Embed
What would you like to do?
SemiRestore11 Using command "GUID"
#!/bin/bash
COMMAND=`basename $0`
while getopts mhv OPTION
do
case $OPTION in
m ) OPTION_m="TRUE" ;;
h ) OPTION_h="TRUE" ;;
v ) OPTION_v="TRUE" ;;
* ) echo "Usage: $COMMAND [-h | -m]" 1>&2
exit 1 ;;
esac
done
shift $((OPTIND - 1))
if [ "$OPTION_h" = "TRUE" ]; then
echo "Usage: "
echo
echo " guid -h -- This help"
echo " guid -m -- GUID lower case letters"
echo " guid -v -- Version"
echo
exit 0
fi
if [ "$OPTION_v" = "TRUE" ]; then
echo "guid version 0.1 (iphoneos arm64)"
exit 0
fi
if [ "$OPTION_m" = "TRUE" ]; then
ioreg -p IODeviceTree -l | grep boot-manifest-hash | sed -E 's/\s|\||(\".{0,20}\")|[<,>,=]//g'
else
ioreg -p IODeviceTree -l | grep boot-manifest-hash | sed -E 's/\s|\||(\".{0,20}\")|[<,>,=]//g' | sed -E 's/(.)/\u\1/g'
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment