Scriptman
19-11-09, 17:39

voor de 221 is het script hier boven :-)
#!/bin/bash
if [ "$1" = "" ]; then
echo "ERR (2): Please fill in the parameters"
echo " ./pxe.sh IP GW NW PASS DISK"
exit 0
fi
if [ "$2" = "" ]; then
echo "ERR (2): Please fill in the parameters"
echo " ./pxe.sh IP GW NW PASS DISK"
exit 0
fi
if [ "$3" = "" ]; then
echo "ERR (2): Please fill in the parameters"
echo " ./pxe.sh IP GW NW PASS DISK"
exit 0
fi
if [ "$4" = "" ]; then
echo "ERR (2): Please fill in the parameters"
echo " ./pxe.sh IP GW NW PASS DISK"
exit 0
fi
if [ "$5" = "" ]; then
echo "ERR (2): Please fill in the parameters"
echo " ./pxe.sh IP GW NW PASS DISK"
exit 0
fi
mkdir /newsystem
cd /newsystem
wget http://mirror.oxilion.nl/centos/5/os...oot/initrd.img
wget http://mirror.oxilion.nl/centos/5/os...xeboot/vmlinuz
cp vmlinuz /boot/vmlinuz.cent.pxe
cp initrd.img /boot/initrd.img.cent.pxe
yum install grub -y
echo "default 0" > /boot/grub/menu.lst
echo "timeout 30" >> /boot/grub/menu.lst
echo "title Centos Install (PXE)" >> /boot/grub/menu.lst
echo "kernel /boot/vmlinuz.cent.pxe vnc vncpassword=$4 headless ip=$1 netmask=$3 gateway=$2 dns=91.121.116.217 ksdevice=eth0 method=http://mirror.oxilion.nl/centos/5/os/i386/ lang=en_US keymap=us" >> /boot/grub/menu.lst
echo "root (hd0,0)" >> /boot/grub/menu.lst
echo "initrd /boot/initrd.img.cent.pxe" >> /boot/grub/menu.lst
grub-install $5
sh SCRIPTNAAM IP GW NW PASS DISK
SCRIPTNAAM: hoe je het script hebt genoemt
IP: ip van je server
GW: gateway van je server (bekijk dit door grep GATE /etc/sysconfig/network)
NW: network van je server (gewoon 255.255.255.0)
DISK: de disk waarop je boot (/dev/sda bij de ni nieuwe servers)
sh intall 10.10.10.10 10.10.10.192 255.255.255.0 TEST123 /dev/sda
SCRIPTNAAM: hoe je het script hebt genoemt
IP: ip van je server
GW: gateway van je server (bekijk dit door grep GATE /etc/sysconfig/network)
NW: network van je server (gewoon 255.255.255.0)
PASS: het wachtwoord
DISK: de disk waarop je boot (/dev/sda bij de ni nieuwe servers)