aboutsummaryrefslogtreecommitdiffstats
path: root/virginize.sh
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2011-04-05 09:24:08 +0300
committerFilipp Lepalaan <filipp@mac.com>2011-04-05 09:24:08 +0300
commita1531de87130993a90e6086e9da85733a85e1dc1 (patch)
treecef95c360ba5cd4e9d22e989632589ef10f174e8 /virginize.sh
parent6dff30e12a9cf14c51675b35a519d1980a0f3ce1 (diff)
downloadmtk-a1531de87130993a90e6086e9da85733a85e1dc1.tar.gz
mtk-a1531de87130993a90e6086e9da85733a85e1dc1.tar.bz2
mtk-a1531de87130993a90e6086e9da85733a85e1dc1.zip
doc
Diffstat (limited to 'virginize.sh')
-rw-r--r--virginize.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/virginize.sh b/virginize.sh
new file mode 100644
index 0000000..b2b00ae
--- /dev/null
+++ b/virginize.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# virginize.sh
+# Make an OS X appear as if it was started up for the first time
+# @author Filipp Lepalaan <filipp@mcare.fi>
+# @package mtk
+
+TARGET=$1
+
+if [[ ! -d "${TARGET}/System/Library/CoreServices" ]]; then
+ exit "Bad target: ${TARGET}"
+fi
+
+rm -rf "${TARGET}/Users/Shared/*"
+/usr/bin/find "${TARGET}/Users" -depth 1 -maxdepth 1 \! -name Shared -type d
+
+rm "${TARGET}/var/db/.AppleSetupDone"
+touch "${TARGET}/var/db/.RunLanguageChooserToo"