#!/bin/sh
#Tag 0x00000f00
#ident "$Revision $"

# This is an example script to configure an IRIX system in the miniroot
# when installations are completed. It is normally run as a "postinst"
# command from a RoboInst mrconfig file.

echo "configuring the system:"
# fallback "make it workable" support, in case perl bombs...
mkdir -p $SGI_ROOT/var/yp
echo "domain.com" > /root/var/yp/ypdomain
echo `hostname` > /root/etc/sys_id
hn=`hostname`
if `grep ${hn} /root/etc/hosts >/dev/null 2>&1`; then
    echo hosts file OK.
else
    echo '# auto-generated hosts entry' >> /root/etc/hosts
    # poor-man's merge: (only works with exact duplicates)
    /root/usr/bin/fgrep -vf /root/etc/hosts /etc/hosts >> /root/etc/hosts
fi
# should have been done by the system...
# site-specific, and will vary if more than one interface
echo "netmask 255.255.255.0" > /root/etc/config/ifconfig-1.options

# how to run Perl from the miniroot:
if test -x /root/usr/bin/perl -a -s /custom/miniconfig.pl ; then
    LD_LIBRARYN32_PATH=/root/usr/lib32 PERL5LIB=/custom:/root/usr/share/lib/perl5 /root/usr/bin/perl /custom/miniconfig.pl
else
    echo couldn\'t run perl script for configure!
fi

echo
echo end of /custom/mypostinst script
