aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2010-02-23 11:30:50 +0200
committerFilipp Lepalaan <filipp@mac.com>2010-02-23 11:30:50 +0200
commit31570178e47653ca0e026009a7996e2f664d4aa6 (patch)
tree2632d2d5fcab130df9ded87711c28ec0e74d0d5a
parent3343446f4604c96f3b184e6b8261ee7738ef72b7 (diff)
downloadmtk-31570178e47653ca0e026009a7996e2f664d4aa6.tar.gz
mtk-31570178e47653ca0e026009a7996e2f664d4aa6.tar.bz2
mtk-31570178e47653ca0e026009a7996e2f664d4aa6.zip
Added sandman
-rwxr-xr-xmake_boot/makeboot.sh6
-rw-r--r--sandman.command17
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