From a1531de87130993a90e6086e9da85733a85e1dc1 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 5 Apr 2011 09:24:08 +0300 Subject: doc --- virginize.sh | 17 +++++++++++++++++ whatbuild.sh | 8 +++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 virginize.sh 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 +# @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" diff --git a/whatbuild.sh b/whatbuild.sh index 2a2b77e..8c95917 100755 --- a/whatbuild.sh +++ b/whatbuild.sh @@ -1,10 +1,12 @@ #! /usr/bin/env bash # whatbuild.sh # @description determine build number of OS on target volume -# @package mtk +# The most accurate place to read this would be inside BaseSystem.pkg, but +# that's a hell of a lot of work and in my tests they seem to be the same. # @author Filipp Lepalaan +# @package mtk -USAGE="$(basename $0) [volume=/]" +USAGE="$(basename $0) [volume | /]" VOLUME=${1:-"/"} PLIST="${VOLUME}/System/Library/CoreServices/SystemVersion.plist" @@ -19,4 +21,4 @@ if [[ ! -e "${PLIST}" ]]; then fi /usr/libexec/PlistBuddy -c 'Print ProductBuildVersion' "${PLIST}" -exit 0 \ No newline at end of file +exit 0 -- cgit v1.2.3