diff options
author | Filipp Lepalaan <filipp@mac.com> | 2010-11-17 17:26:53 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2010-11-17 17:26:53 +0200 |
commit | 0d4d8bfde80e4d7efcb4bab14627a6c97a185dc7 (patch) | |
tree | af16acf53cd07a7bb120ef12452cddec83b80fd9 | |
parent | 9e2dba8c295bc4a328590c4eabfd4afe2f78c9f6 (diff) | |
download | mtk-0d4d8bfde80e4d7efcb4bab14627a6c97a185dc7.tar.gz mtk-0d4d8bfde80e4d7efcb4bab14627a6c97a185dc7.tar.bz2 mtk-0d4d8bfde80e4d7efcb4bab14627a6c97a185dc7.zip |
added netbless
-rw-r--r-- | aptest.app/Contents/Resources/Scripts/main.scpt | bin | 3234 -> 3512 bytes | |||
-rwxr-xr-x | netbless.sh | 42 | ||||
-rw-r--r-- | nyetboot.command | 0 |
3 files changed, 42 insertions, 0 deletions
diff --git a/aptest.app/Contents/Resources/Scripts/main.scpt b/aptest.app/Contents/Resources/Scripts/main.scpt Binary files differindex a32a4f0..cc1c22a 100644 --- a/aptest.app/Contents/Resources/Scripts/main.scpt +++ b/aptest.app/Contents/Resources/Scripts/main.scpt diff --git a/netbless.sh b/netbless.sh new file mode 100755 index 0000000..72e3b3b --- /dev/null +++ b/netbless.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +SERVER=sw.mcare.fi +SERVER_PATH="/data/nb" + +if [[ ${USER} != "root" ]]; then + echo "This must be run as root" 2>&1 + exit 1 +fi + +SERVER_IP=$(dig +short ${SERVER}) + +ME=$(/usr/sbin/sysctl -n hw.model) +MACHINE=$(sysctl -n hw.machine) + +if [[ -z ${ME} ]]; then + echo "Error: could not determine hardware model" 2>&1 + exit 1 +fi + +IMAGES=$(/usr/bin/curl -s http://${SERVER}/mh/) + +if [[ $1 == "help" ]]; then + echo -e "Usage: $(basename $0) [${IMAGES}]" 2>&1 + exit 0 +fi + +for IMG in ${IMAGES} +do + if [[ "${IMG}" == "${ME}.nbi" || "${IMG}" == "$1" ]] + then + /usr/sbin/bless --netboot \ + --booter tftp://${SERVER_IP}/${IMG}/${MACHINE}/booter \ + --kernel tftp://${SERVER_IP}/${IMG}/${MACHINE}/mach.macosx \ + --options "rp=nfs:${SERVER_IP}:${SERVER_PATH}:/${IMG}/NetInstall.dmg" + echo "NetBoot set" + exit 0 + fi +done + +echo "Error: model ${ME} not found on the NetBoot server" 2>&1 +exit 1 diff --git a/nyetboot.command b/nyetboot.command deleted file mode 100644 index e69de29..0000000 --- a/nyetboot.command +++ /dev/null |