diff options
-rwxr-xr-x | make_boot/makeboot.sh | 6 | ||||
-rw-r--r-- | sandman.command | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/make_boot/makeboot.sh b/make_boot/makeboot.sh index f1e88ed..135d978 100755 --- a/make_boot/makeboot.sh +++ b/make_boot/makeboot.sh @@ -32,12 +32,12 @@ DMG_FILE=./boot.sparseimage echo "Creating disk image..." hdiutil create "${DMG_FILE}" -volname "${VOL_NAME}"\ -size 5G -type SPARSE -fs HFS+ -stretch 10G\ - -uid 0 -gid 80 -mode 775 -layout NONE -ov 2>&1 + -uid 0 -gid 80 -mode 775 -layout NONE -ov > /dev/null 2>&1 chmod 777 "${DMG_FILE}" echo "Mounting disk image..." -hdiutil attach "${DMG_FILE}" -mountpoint "${TMP_MOUNT_POINT_PATH}" +hdiutil attach "${DMG_FILE}" -mountpoint "${TMP_MOUNT_POINT_PATH}" > /dev/null 2>&1 echo "Preparing disk image..." mdutil -i off "${TMP_MOUNT_POINT_PATH}" > /dev/null 2>&1 @@ -53,7 +53,7 @@ echo "Cloning system (this will take a while)..." echo "Doing boot things..." -kextcache -l -m "${TMP_MOUNT_POINT_PATH}"/System/Library/Extensions.mkext\ +kextcache -a i386 -N -L -S -m "${TMP_MOUNT_POINT_PATH}"/System/Library/Extensions.mkext\ "${SOURCE}"/System/Library/Extensions bless --folder "${TMP_MOUNT_POINT_PATH}"/System/Library/CoreServices\ diff --git a/sandman.command b/sandman.command new file mode 100644 index 0000000..5dca427 --- /dev/null +++ b/sandman.command @@ -0,0 +1,17 @@ +#! /usr/bin/env bash +if [[ $USER != "root" ]]; then + echo "This must be run as root" + exit 1 +fi + +ROOTPW="1234" +DELAY=120 +LOGFILE=~/Desktop/sandman.command.log + +osascript -e "delay $DELAY" +TIMESTAMP=$(php -r "echo date ('H:i:s"', time() + $DELAY);") +echo $ROOTPW | sudo -S pmset repeat poweron MTWRFSU $TIMESTAMP +echo -n $(date "+%d.%m.%y @ %H:%I:%S") >> $LOGFILE +echo " " $(wc -l $LOGFILE) >> $LOGFILE +osascript -e "tell application "Finder" to shut down" +exit 0 |