#!/bin/sh # @(#)$KimmoSuominen: post,v 1.3 2005/02/20 20:10:46 kim Exp $ export PATH PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin DIR=/var/tmp/post.$$ umask 002 case `hostname -d` in fulton.blink.com) type=dev ;; *) type=prod ;; esac mkdir -p /home/prod ln -s /home/prod /tmp mkdir -p /u cd /u ln -s ../home/blink . rm -f /root/.bash_logout mkdir -p $DIR cd $DIR || exit 1 for i in \ bin \ etc-$type \ home \ root \ usr.X11R6 \ usr.bin \ usr.lib \ usr.local \ usr.sbin \ usr.share do wget -q ftp://build/u/RedHat-7.1/pack/$i.tar.gz done for i in *.tar.gz do case $i in *-*) if expr "$i" : ".*-$type.*" > /dev/null then i=`echo $i | sed -e s,-$type.*,,g`; else continue; fi;; *) i=`echo $i | sed -e s,.tar.gz,,g`;; esac inst=`echo $i | sed -e 's,\.,/,g'` echo -n "/$inst <- " for j in $DIR/$i.tar.gz $DIR/$i-$type.tar.gz do if [ -f $j ] then echo $j cd /$inst && tar -xzpf $j fi done done cd / && rm -rf $DIR for i in xfs sendmail rhnsd amd autofs nfs nfslock smb ypserv ypbind yppasswdd do chkconfig --level 123456 $i off done cd /etc/sysconfig && cp -p network network.$$ && ( grep -v '^HOSTNAME=' network.$$ > network chown root:root network chmod 644 network rm -f network.$$ ) cd / if [ "$type" = "dev" ] then echo 'DOMAINNAME="blink.com"' >> /etc/sysconfig/network echo 'NISDOMAIN="blink.com"' >> /etc/sysconfig/network ed - /var/yp/securenets << _EOF $ d i 255.255.255.0 64.52.37.0 255.255.255.0 166.84.150.0 . w q _EOF domainname blink.com /usr/lib/yp/ypinit -s master.fulton.blink.com mkdir -p /var/spool/lpd/lphp2100 mkdir -p /var/spool/lpd/lphp4000 mkdir -p /var/spool/lpd/lphp4050 #chown -R daemon:daemon /var/spool/lpd #chmod -R 2775 /var/spool/lpd chown -R lp:lp /var/spool/lpd chmod -R 0700 /var/spool/lpd for i in smb ypserv ypbind do chkconfig --level 2345 $i on done # change run-level to 5 # run xdm (instead of prefdm) ( cd /etc rm -f inittab.new sed -e '/^id:/s/:[0-9]:/:5:/' \ -e '/^x:/s,:/.*$,:/usr/X11R6/bin/xdm -nodaemon,' \ < inittab > inittab.new \ && mv inittab.new inittab chmod go=r inittab ) # enable XDMCP ( cd /etc/X11/xdm rm -f xdm-config.new sed -e '/^DisplayManager.requestPort:/s/^/!/' \ < xdm-config > xdm-config.new \ && mv xdm-config.new xdm-config chmod a=r xdm-config ) fi for i in ntpd do chkconfig --level 2345 $i on done for i in postfix httpd jserv do chkconfig --add $i chkconfig --level 2345 $i on done mkdir -p /var/log/jserv chmod a+rx /root mkdir -p /var/spool/postfix /usr/local/sbin/postfix check /usr/local/sbin/postalias hash:/etc/aliases rm -f /etc/aliases.db rm -f /etc/postfix/virtual.db ( cd /etc/postfix && make )