problem %post script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello all

In fact I have 2 problem (I have made my own red hat 7.2cd that's for why you can see 'rtl los in %packages')

-first  is that when i put this post script on my kickstart file the installation stop just after the boot installer and i have a lovely blue screen and when i execute the script after the installation it cause no trouble                                                                                                                                                                                  

- the second is not about kickstart but maybe someone can help me when i execute that scrip all my parameters become good but when i reeboot the "ifconfig" is erased

here is my kickstart file

thanks in advance for your help

bye  

 

#Generated by Kickstart Configurator

lang en_US

langsupport en_US

mouse none

reboot

text

bootloader --useLilo --linear --location=mbr

install

cdrom

auth --useshadow --enablemd5

firewall --disabled

#Do not configure the X Window System

skipx

%packages

@RTLlos

%post

#PE 6/03/03

###Request all necessary variable###

question()

{

#ip adress

echo -e "What is your ip address : \c"

read IP

export IP

#default gateway

echo -e "what is your default gateway : \c"

read DFG

export DFG

#netmask

echo -e "what is your netmask : \c"

read NM

export NM

#Domain

#Generated by Kickstart Configurator

lang en_US

langsupport en_US

mouse none

reboot

text

bootloader --useLilo --linear --location=mbr

install

cdrom

auth --useshadow --enablemd5

firewall --disabled

#Do not configure the X Window System

skipx

%packages

@RTLlos

%post

#PE 6/03/03

###Request all necessary variable###

question()

{

#ip adress

echo -e "What is your ip address : \c"

read IP

export IP

#default gateway

echo -e "what is your default gateway : \c"

read DFG

export DFG

#netmask

echo -e "what is your netmask : \c"

read NM

export NM

#Domain

echo -e "what is your domain : \c"

read DM

export DM

#hostname

echo -e "what is your hostname : \c"

read HN

export HN

#display all variables

clear

echo -e "The ip adress is : $IP"

echo -e "The default gateway is : $DFG"

echo -e "The netmask is : $NM"

echo -e "The Domain is : $DM "

echo -e "The hostname is : $HN"

echo -e "The dns is : $IP"

echo -e "Please confirm by y/n or quit: \c"

read ANSW

case $ANSW in

y)

initnetwork

;;

n)

question

;;

quit)

echo $0" interrupted !!!"

exit 1

;;

*) echo Invalid choice

sleep 1

question

esac

}

initnetwork()

{

#start configuration

#/etc/sysconfig/network-scripts/ifcfg-eth0

echo -e "Make change in /etc/sysconfig/network-scripts/ifcfg-eth0"

echo "DEVICE=eth0">/etc/sysconfig/network-scripts/ifcfg-eth0

echo "BOOTPROTO=static">>/etc/sysconfig/network-scripts/ifcfg-eth0

echo "`ipcalc -b $IP $NM`">>/etc/sysconfig/network-scripts/ifcfg-eth0

echo "IPADR=$IP">>/etc/sysconfig/network-scripts/ifcfg-eth0

echo "NETMASK=$NM">>/etc/sysconfig/network-scripts/ifcfg-eth0

echo "`ipcalc -n $IP $NM`">>/etc/sysconfig/network-scripts/ifcfg-eth0

echo ">

#/etc/sysconfig/network

echo -e "Make change in /etc/sysconfig/network"

echo "NETWORKING=yes">/etc/sysconfig/network

echo "HOSTNAME=\"$HN\"">>/etc/sysconfig/network

echo "GATEWAY=$DFG">>/etc/sysconfig/network

#/etc/hosts

echo -e "Make change in /etc/hosts"

echo "127.0.0.1" "localhost.localdomain" "localhost">/etc/hosts

echo "$IP" "$HN" "$HN"."$DM">>/etc/hosts

# ifconfig

echo -e Make change in ifconfig

ifconfig eth0 down

ifconfig eth0 $IP netmask $NM

ifconfig eth0 up

route add default gw $DFG

}

losconf()

{

mount /mnt/cdrom

cp /mnt/cdrom/RedHat/RPMS/los-config-*.rpm /root/

}

Main()

{

question

losconf

exit 0

}

Mai


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux