No subject
Thu Apr 19 13:57:37 EDT 2007
"Here is what I have so far. The GETCLUSTER function needs work so the
user can select the level of the OS install. When I get some refinements in
place, I will forward them." (Attachment jumpstart_interactive)
Jeff's is also a great template. After reviewing his code, I found mine
sloppy and lacking and had to refine mine to be a little more like his
before I could, in good conscience, share it with anyone....
Finally, here is my blatant theft of Nicole's script, which is hers with
some additional basic error-checking, add clients to /etc/ethers and
/etc/hosts, and create a custom sysidcfg file based on a template
(sysidcfg.orig); but without support for anything other than Solaris 7 and
8 (although I haven't tested Solaris 7 yet...) (Attachments
Jumpstart_setup.sh and sysidcfg.orig)
Thank you again to everyone for their suggestions, assistance, and scripts!
Steve Chapman
[demime 0.99c.7 removed an attachment of type application/octet-stream which had a name of setup_for_jumpstart]
[demime 0.99c.7 removed an attachment of type application/octet-stream which had a name of v100_appl.finish]
[demime 0.99c.7 removed an attachment of type application/octet-stream which had a name of v100_appl.mkconfig]
~#!/bin/ksh
# addc -- add jumpstart client script
#define some constants
JUMP="/export/jumpstart"
REVS="Solaris-8_0202 Solaris-9_0902"
NICS="hme0 qfe0 ge0 le0"
ARCHS="sun4u sun4m"
SERVER=""
SIP=""
SUBNET=""
# start questionaire
print ""
echo "Add jumpstart client"
echo "--------------------"
print ""
# get hostname
while true; do
echo "Hostname:\c"
read HOST
case $HOST in
[0-9]*) ;;
"");;
*) break;;
esac
done
# get IP address.
while true; do
echo "IP address: \c"
read IP
case $IP in
+([0-9]).+([0-9]).+([0-9]).+([0-9]) ) break;;
*);;
esac
done
# get MAC address.
while true; do
echo "Ethernet address (MAC): \c"
read MAC
case $MAC in
*(0)8:*(0)0:20:*:*:*) break;;
*(0)0:*(0)0:c:*:*:*) break;;
*);;
esac
done
# get NIC type. Limited flexibility.
echo "Select NIC type:"
select NIC in $NICS; do
if [[ ! "$REPLY" -gt "$(echo $NICS|wc -w)" ]]; then
break
fi
done
# get Architecture of client
echo "Select architecture:"
select ARCH in $ARCHS; do
if [[ ! "$REPLY" -gt "$(echo $ARCHS|wc -w)" ]]; then
break
fi
done
# Which revision of Solaris 8?
echo "Which revision/update of Solairs 8 do you want to install?"
select REV in $REVS; do
if [[ ! "$REPLY" -gt "$(echo $REVS|wc -w)" ]]; then
break
fi
done
# Now we know which image to use
IMAGES="/export/$REV"
# set up the sysidcfg file
/bin/rm -rf ${JUMP}/sysidcfg/${HOST}
mkdir ${JUMP}/sysidcfg/${HOST}
cp ${JUMP}/sysidcfg/template ${JUMP}/sysidcfg/${HOST}/sysidcfg
# get the network and default router, set up the server name
SUBNET=${IP%.*}
case $SUBNET in
'xxx.xxx.208') SERVER=jumpstart-208
SIP=xxx.xxx.208.xxx;;
'xxx.xxx.64' ) SERVER=jumpstart-64
SIP=xxx.xxx.64.xxx;;
* ) echo "invalid network!" && exit;;
esac
default_router=${SUBNET}.xxx
# add this host to the /etc/hosts file
egrep -v "$HOST|$IP" /etc/hosts > /tmp/hosts
cat /tmp/hosts > /etc/hosts
echo "$IP $HOST" >> /etc/hosts
# clean up existing ether address (there may be host name change)
egrep -v "$HOST|$MAC" /etc/ethers > /tmp/ethers
cat /tmp/ethers > /etc/ethers
# fix the sydidcfg file
( echo "/name_server=/";echo "s/=/=${SERVER}(${SIP})/";
echo "/interface=/";echo "s/=/=${NIC}/";
echo "/default_route=/"; echo "s/=/=${default_router}/";
echo "w";echo "w";echo "q" ) | \
ed -s "${JUMP}/sysidcfg/${HOST}/sysidcfg" > /dev/null
# Done collecting data. Now processing
echo "Processing data ... Please wait."
args="-e $MAC -i $IP -c ${SERVER}:${JUMP} \
-p ${SERVER}:${JUMP}/sysidcfg/${HOST} $HOST $ARCH"
echo ${IMAGES}/Solaris*/Tools/add_install_client $args
${IMAGES}/Solaris*/Tools/add_install_client $args
[demime 0.99c.7 removed an attachment of type application/octet-stream which had a name of sysidcfg.orig]
[demime 0.99c.7 removed an attachment of type application/octet-stream which had a name of Jumpstart_setup.sh]
_______________________________________________
sunmanagers mailing list
sunmanagers at sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
More information about the summaries
mailing list