From 0d4d8bfde80e4d7efcb4bab14627a6c97a185dc7 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 17 Nov 2010 17:26:53 +0200 Subject: added netbless --- aptest.app/Contents/Resources/Scripts/main.scpt | Bin 3234 -> 3512 bytes netbless.sh | 42 ++++++++++++++++++++++++ nyetboot.command | 0 3 files changed, 42 insertions(+) create mode 100755 netbless.sh delete mode 100644 nyetboot.command diff --git a/aptest.app/Contents/Resources/Scripts/main.scpt b/aptest.app/Contents/Resources/Scripts/main.scpt index a32a4f0..cc1c22a 100644 Binary files a/aptest.app/Contents/Resources/Scripts/main.scpt and b/aptest.app/Contents/Resources/Scripts/main.scpt differ 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 -- cgit v1.2.3