Re: e-mailing from post

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

 



On Thu, 20 Mar 2003 James_Martin@xxxxxxxxxxxxxxx wrote:

> I want to send an email in the %post section notifying me of when a build
> is complete..  The email consists of a log of the %post commands as well as
> a date stamp.  The following command does not seem to work from %post, but
> will work when it is run after the machine is fully installed.
> 
> mail myemail@xxxxxxxxxxx < /root/kickstart-post.log
> 
> Any ideas?

This works:
%post --nochroot
(
echo To: root@[127.0.0.1]
echo From: RedHat-Linux-Installer@xxxxxxxxxxxxxxxxxxxxxxx
echo Subject: Installation of Red Hat Linux

set
set -x
cp /etc/resolv.conf /mnt/sysimage/etc
URL=$(echo ${ANACONDAARGS} | chroot /mnt/sysimage awk '{print $2}' )
BASEURL=$(chroot /mnt/sysimage dirname  ${URL} )
chroot /mnt/sysimage  wget -P /etc/init.d
${BASEURL}/ks/postinstall/ks.post
chmod +x /mnt/sysimage/etc/init.d/ks.post
chroot /mnt/sysimage chkconfig ks.post on
for p in dhcpcd lilo efax finger rsh talk mutt rsh-server telnet-server
talk-server postgresql-devel \
          tux iptables-ipv6
            do chroot /mnt/sysimage rpm --erase -v ${p}
            done
REL=$(chroot /mnt/sysimage rpm -q redhat-release | sed -e
's=[-a-zA-Z]*==;s=-.*==')
RH=192.168.1.1
RDname=/var/ftp/pub/linux/RedHat/${REL}

NFSOPTS="user,soft,intr,noauto,exec"
echo ${RH}:${RDname}    /mnt/nfs        nfs     ${NFSOPTS}
echo ${RH}:${RDname}    /mnt/nfs        nfs     ${NFSOPTS}
>>/mnt/sysimage/etc/fstab
mkdir /mnt/sysimage/mnt/nfs
ed <<. /mnt/sysimage/etc/sysctl.conf
H
/kernel.sysrq/s=0=1=
wq



[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