Difference between revisions of "S99ldomreconfig"

From Peter Pap's Technowiki
Jump to: navigation, search
(Created page with "#!/bin/sh AWK=/usr/bin/awk CAT=/usr/bin/cat CATMAN=/usr/bin/catman CHGRP=/usr/bin/chgrp CHMOD=/usr/bin/chmod CHOWN=/usr/bin/chown CHROOT=/usr/sbin/chroot CP=/usr/bin/cp DATE=/us...")
 
 
Line 1: Line 1:
#!/bin/sh
+
<pre>#!/bin/sh
  
 
AWK=/usr/bin/awk
 
AWK=/usr/bin/awk
Line 72: Line 72:
  
 
         $RM /etc/rc3.d/S99ldomreconfig
 
         $RM /etc/rc3.d/S99ldomreconfig
 +
</pre>

Latest revision as of 05:45, 1 June 2011

#!/bin/sh

AWK=/usr/bin/awk
CAT=/usr/bin/cat
CATMAN=/usr/bin/catman
CHGRP=/usr/bin/chgrp
CHMOD=/usr/bin/chmod
CHOWN=/usr/bin/chown
CHROOT=/usr/sbin/chroot
CP=/usr/bin/cp
DATE=/usr/bin/date
ECHO=/usr/bin/echo
FIND=/usr/bin/find
GREP=/usr/bin/grep
LN=/usr/bin/ln
MKDIR=/usr/bin/mkdir
MOUNT=/usr/sbin/mount
MV=/usr/bin/mv
PATCHADD=/usr/sbin/patchadd
PROJADD=/usr/sbin/projadd
RM=/usr/bin/rm
ROUTE=/usr/sbin/route
SED=/usr/bin/sed
SORT=/usr/bin/sort
SVCCFG=/usr/sbin/svccfg
TOUCH=/usr/bin/touch
UNAME=/sbin/uname
USERADD=/usr/sbin/useradd
export AWK CAT CATMAN CHGRP CHMOD CHOWN CHROOT CP DATE ECHO FIND GREP LN MKDIR MOUNT MV PATCHADD PROJADD RM ROUTE SED SORT SVCCFG TOUCH UNAME USERADD

$ECHO "==> solaris10-finish starting" `date`

$ECHO "==> Adding /etc/hosts entries"
        $CP /etc/inet/hosts /etc/inet/hosts.orig
        $GREP -v loghost /etc/inet/hosts > /etc/inet/hosts.tmp
        $GREP loghost /etc/inet/hosts | $AWK ' { print $1"\t"$2" "$2".mydomain.com.au" } ' >> /etc/inet/hosts.tmp
        $MV /etc/inet/hosts.tmp /etc/inet/hosts
        $CAT << EOF >> /etc/hosts
192.168.1.10 loghost
192.168.1.11 ntp
EOF

$ECHO "==> Adjusting sendmail setup for MyDomain"

        $CP -p /etc/mail/sendmail.cf /etc/mail/sendmail.cf.orig
        $SED -e 's/#Dj$w.Foo.COM/Dj$w.mydomain.com.au/' < /etc/mail/sendmail.cf > /tmp/sendmail.cf
        $MV /tmp/sendmail.cf /etc/mail/sendmail.cf
        $SED -e 's/^DS/DSmailhost.$m/' < /etc/mail/sendmail.cf > /tmp/sendmail.cf
        $MV /tmp/sendmail.cf /etc/mail/sendmail.cf
        $CAT << EOF > /tmp/sed.cmd
/C{E}root/a\\
C{M}`$UNAME -n`.mydomain.com.au\\
\\
# Domain I wish to masquerade as\\
DMmydomain.com.au
EOF
        $SED -f /tmp/sed.cmd /etc/mail/sendmail.cf > /tmp/sendmail.cf
        $MV /tmp/sendmail.cf /etc/mail/sendmail.cf
        $CHMOD 444 /etc/mail/sendmail.cf

$ECHO "==> Creating man windex pages"
        $MOUNT -F proc /proc /proc
        $CATMAN -w -M /usr/share/man
        $CATMAN -w -M /usr/openwin/man
        $CATMAN -w -M /usr/dt/man
        $CATMAN -w -M /usr/dt/share/man
        $SORT -u -o /usr/share/man/windex /usr/share/man/windex


$ECHO "==> solaris10-post finished" `date`
$ECHO "==> cleaning Up"

        $RM /etc/rc3.d/S99ldomreconfig