aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2010-12-10 20:52:19 +0200
committerFilipp Lepalaan <filipp@mac.com>2010-12-10 20:52:19 +0200
commit673dd12fcbbd5b8def0e9eb7d6997f8a55a2d5f4 (patch)
tree53fcead6d504a9ec2f358478a6f19818143521cc
parente0bb9180af98961a43c15048e11475bfe8d96186 (diff)
downloadmtk-673dd12fcbbd5b8def0e9eb7d6997f8a55a2d5f4.tar.gz
mtk-673dd12fcbbd5b8def0e9eb7d6997f8a55a2d5f4.tar.bz2
mtk-673dd12fcbbd5b8def0e9eb7d6997f8a55a2d5f4.zip
netbless fixes
-rwxr-xr-xnetbless.sh22
-rwxr-xr-xup2date.sh3
2 files changed, 14 insertions, 11 deletions
diff --git a/netbless.sh b/netbless.sh
index dc3a9bc..c9b5ad5 100755
--- a/netbless.sh
+++ b/netbless.sh
@@ -4,15 +4,19 @@
# @author Filipp Lepalaan <filipp@mcare.fi>
# @package mtk
-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})
+if [[ $1 == "help" ]]; then
+ echo "Usage: $(basename $0) [nbi] [url] [nbi_path]" 2>&1
+ exit 0
+fi
+
+SERVER_PATH=${3:-"/data/nb"}
+SERVER=${2:-"http://sw.mcare.fi/mh/"}
+SERVER_IP=$(/usr/bin/dig +short ${SERVER})
ME=$(/usr/sbin/sysctl -n hw.model)
MACHINE=$(sysctl -n hw.machine)
@@ -26,10 +30,10 @@ if [[ -z $ME ]]; then
exit 1
fi
-IMAGES=$(/usr/bin/curl -s http://${SERVER}/mh/)
+IMAGES=$(/usr/bin/curl -s ${SERVER})
-if [[ $1 == "help" ]]; then
- echo -e "Usage: $(basename $0) [${IMAGES}]" 2>&1
+if [[ $1 == "list" ]]; then
+ echo -e "Available images: [${IMAGES}]" 2>&1
exit 0
fi
@@ -41,8 +45,8 @@ do
--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" \
- --nextonly
- echo "NetBoot set to ${ME}.nbi"
+ --nextonly \
+ echo "Startup volume set to ${ME}.nbi"
exit 0
fi
done
diff --git a/up2date.sh b/up2date.sh
index d64d7f6..3e27f4f 100755
--- a/up2date.sh
+++ b/up2date.sh
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
# up2date.sh
-# Run software update until there are no more
-# updates available.
+# Run software update until there are no more updates available.
# @author Filipp Lepalaan
# @package mtk