#!/bin/sh rootProfile='/var/root/.profile' tmp='/private/tmp/applejack.install' scriptLoc='/var/root/Library/Scripts' manLoc='/usr/share/man/man8' docLoc='/Library/Documentation/AppleJack' if [ -e "$rootProfile" ]; then /usr/bin/sed -e '/[Aa]pple[Jj]ack/d' "$rootProfile" > "$tmp"; fi; /bin/echo "alias applejack='/var/root/Library/Scripts/applejack.sh' #AppleJack Installer" >> "$tmp"; /bin/echo 'echo "" #AppleJack Installer' >> "$tmp"; /bin/echo 'echo "For troubleshooting assistance, just type applejack at the prompt" #AppleJack Installer' >> "$tmp"; sed -e "s/type applejack at/type 'applejack' at/" "$tmp" > "$rootProfile"; /bin/rm -f "$tmp"; #clean up any old installs echo "Searching for and removing any AppleJack man caches..." find /usr/share/man -name 'applejack.*.gz' -exec rm -v {} \; echo "Done." echo "Searching for and removing AppleJack man pages..." find /usr -type f \( -name 'applejack.8' -o -name 'applejack.1' \) -exec rm -fv {} \; echo "done." /bin/chmod 0600 "$rootProfile"; if [ ! -d /var/root/Library/Scripts ]; then /bin/mkdir -p -m 0700 "$scriptLoc"; fi; /bin/cp -f applejack.sh "$scriptLoc"; /bin/cp -f applejack.8 "$manLoc"; /usr/sbin/chown root:wheel "${scriptLoc}/applejack.sh" "$manLoc/applejack.8"; /bin/chmod 0700 "${scriptLoc}/applejack.sh"; exit 0