#!/bin/sh
# ex:se ts=8 sw=8:
# ****************************************************************************
#
# $Id: saipconfig,v 1.2 2000/03/02 12:02:09 root Exp $
#
# ****************************************************************************
#
# Copyright (c) 1988-00 Digi International Inc., All Rights Reserved.
# This software contains proprietary and confidential information of Digi
# International Inc.  By accepting transfer of this copy, Recipient agrees
# to retain this software in confidence, to prevent disclosure to others,
# and to make no use of this software other than that for which it was
# delivered.  This is an unpubliched copyrighted work of Digi International
# Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
# prohibited.
#
# Copyright 2000 Sun Microsystems, Inc. All rights reserved.
#
# Installation script for Digi, Intl. async driver.
#
# To test this script type:
#	sh request 
#					
# ****************************************************************************

DEV="pci114f,1c"
MYPKGINST=SUNWsaip
MAXPORT="16 X 14 X 8"		# Maximum number of ports
USE_TTYMODES=0
USE_INTERRUPTS=0

INSTALLDIR=`pwd`		# Capture original directory

PATH=$PATH:.

# Check if Hardware is present.
/usr/sbin/prtconf -p | egrep -s "${DEV}"
if [ $? -eq 0 ]; then
	hw_exists=1
else
	hw_exists=0
fi

# Check that user is root.
usid=`id | awk -F"=" ' /uid/ { printf $2 } ' | cut -f1 -d"("`
if [ "$usid" -ne 0 ] ; then
	echo "You must be a super-user to execute!"
	exit 1
fi

set /dev/null

#
# yes or no
#
getyn='(while	read yn
	do	case "$yn" in
		[yY])	exit 0
			;;
		[nN])	exit 1
			;;
		*)	echo "	Please answer y or n : \c" >&2
			;;
		esac
	done)'

#
# modports(brd, line, conc, module)
#
modports()
{
	eval t1=\$nports${1}${2}c${3}m${4}
	echo $t1
}

#
# Get next available extend concid from string
#
nextid()
{
	# get the next id from the list
	if [ "$IDLIST1" = " " ]
	then
		# used all ids, start over
		IDLIST1="$IDLIST"
	fi
	id1=`expr "$IDLIST1" : " *\([^ ]*\) "`
	# remove it 
	IDLIST1=`expr "${IDLIST1}" : " *[^ ]*\( .*\)"`

	# count how many times this id has been used
	eval tmp="\$IDCOUNT${id1}"
	if [ -z "$tmp" ]
	then
		tmp=1
	else
		tmp=`expr "$tmp" + 1`
	fi
	eval IDCOUNT${id1}=$tmp
	id2=$tmp
}

#
# Configuration for SUNWsaip Xr.
#
xrconf()
{
	# save state
	tmpid1="$IDLIST1"
	tmpid2="$IDLIST2"
	typemsg="8-port adapter:"

	if [ "$SKIP_CONF" = "false" ] ; then
	echo "\n Adapter type is ${BRDNAME}.
${iodisplay}${memdisplay}
${typemsg}"

	fi # SKIP_CONF

	nconc=1
	eval nconc${n}0="1"

	i=1
	nextid
	eval id${n}0c${i}=$id1
	eval idn${n}0c${i}=$id2

	pn=$n
	pl=0
	pc=1
	pm=0

	eval nports${pn}${pl}c${pc}m${pm}=8

	if [ "$SKIP_CONF" = "false" ] ; then
		echo "\n
In order to reduce response time to small packets (latency), it
may be helpful to enable interrupts on the adapter.  However,
doing this will significantly increase driver CPU usage on your
Solaris system.  By default, interrupts are disabled.  
To enable interrupts, answer no.

Do you want to keep interrupts disabled on the adapter? (y/n)? \c"

		if eval "$getyn"
		then
			eval useint${n}=0
		else
			eval useint${n}=1
		fi

	if [ "$CUST_INST" = "true" ] ; then
		echo "\nWhat instance number would you like for this adapter? \c"
		while :
		do
			read resp
			if [ "$resp" = 0 -o "$resp" -ge 1 -a "$resp" -lt ${MAX_INST} ] 
			then
				i=0
				fail=-1
				# Save current response: inst0=, inst1=,inst2=...
				eval inst$n=$resp

				# Go through previous responses.
				while [ "$i" -lt $n ]
				do
					eval tmpinst=\$inst$i
					if [ $tmpinst -eq $resp ] ; then
						# If response has been used, set fail and break.
						eval fail=\$i
						break
					fi
					i=`expr $i + 1`
				done

				if [ "$fail" = -1 ] ; then
					break
				else
		echo "\nInstance number $resp has been assigned to adapter $fail"
		echo "Please enter an available number between 0 and ${ZB_MAX_INST}: \c"
				fi
			else
				echo "Please enter a number between 0 and ${ZB_MAX_INST}: \c"
			fi
		done
	fi

	else
		eval useint${n}=0
	fi # SKIP_CONF

	if [ $id2 -eq 1 ]
	then
		tmpid="$tmpid $id1"
	fi

	iostr=""
	mstr=""
	if [ "$platform" = "ISA" ]
	then
		iostr="	I/O address:	${porttmp}.
"
	fi
	if [ "$platform" != "MC" -a "$platform" != "PCI" ]
	then
		mstr="	Memory address: ${memory}.
"
	fi

	if [ "$SKIP_CONF" = "true" ] ; then
		echo "The following has been automatically configured for adapter ${n}:"

	else
		tput -T${termtype} clear
		echo "You have selected the following configuration for adapter ${n}:"
	fi

	echo "Adapter Type: ${BRDNAME}.${iostr}${mstr}

	Module	Port Names
      ---------------------------"

	PORTS_PER_MOD=8

	if [ "$CUST_INST" = "false" ] ; then
		grep $DEV /etc/path_to_inst | cut -f2 -d' ' > /tmp/$MYNAME.inst

		while read inst
		do
			echo "INST$cnt $inst" > /tmp/$MYNAME.inst.ed
			cnt=`expr $cnt + 1`
		done < /tmp/$MYNAME.inst
	else
		echo "INST$n $resp" >> /tmp/$MYNAME.inst.ed
	fi
	
	i=1
	while [ "$i" -le $nconc ]
	do
		eval id=\$id${n}0c${i}
		eval pn=\$idn${n}0c${i}
		p1=`expr \( "$pn" - 1 \) \* $PORTS_PER_MOD + 1`
		if [ "$BASE_0" = "true" ] ; then
			# Sun would like base-0 type port names
			p1=`expr $p1 - 1`
		fi

	if [ "$CUST_INST" = "false" ] ; then
		cnt=`grep INST$n /tmp/$MYNAME.inst.ed | cut -f2 -d' ' 2>/dev/null`
		if [ -z "$cnt" ] ; then
			if [ -f /tmp/${MYNAME}.cnt ] ; then
				old_cnt=`cat /tmp/${MYNAME}.cnt 2>/dev/null`
				cnt=`expr $old_cnt + 1`
			else
				cnt=`expr $n + 1`
			fi
		else
			cnt=`expr $cnt + 1`
		fi
	else
		cnt=`expr $resp + 1`
	fi

		newid=`echo $IDLIST | cut -f$cnt -d' ' 2>/dev/null`

		echo "$cnt" > /tmp/${MYNAME}.cnt

		string=`modports $n 0 $i 0`
		p2=`expr "$p1" + "$string" - 1`
		# add the leading zero to p1 if necessary
		p1=`expr "000$p1" : ".*\(...\)$"`
		p2=`expr "000$p2" : ".*\(...\)$"`
		string="term/${newid}${p1} - term/${newid}${p2} -- also /dev/cua/${newid}xxx"
		echo "	$i	$string"
		i=`expr "$i" + 1`
	done
	if [ "$SKIP_CONF" = "true" ] ; then
		return 0
	fi

	eval tmp=\$useint$n
	if [ "$tmp" -eq 0 ] ; then
		echo "                     Interrupts disabled."
	else
		echo "                     Interrupts enabled."
	fi

	echo "
 Is this configuration acceptable (y or n)? \c"
	if eval "$getyn"
	then
		# yes
		return 0
	else
		# no
		# restore state of ID allocation
		IDLIST1="$tmpid1"
		IDLIST2="$tmpid2"
		i=1
		while [ $i -le $nconc ]
		do
			eval id=\$id${n}0c${i}
			eval pn=\$IDCOUNT$id
			pn=`expr "$pn" - 1`
			eval IDCOUNT$id=$pn

			i=`expr $i + 1`
		done
		return 1
	fi
}

#########################################################################
# Main - install epca
#########################################################################

ARCH=`uname -p`

SUN_OEM=true
TPO="Transparent Print"			# Transparent print name
platform="PCI"
MYNAME="saip"
MYPKGNAME="SUNWsaip"
BOARDNAME="SunSAI/P"
PRODNAME="Sun PCI Serial Asynchronous Interface"
FULLNAME="Sun PCI Serial Asynchronous Interface"
MAX_NBRDS=16
MAX_INST=52
# Zero Based Max Instance
ZB_MAX_INST=51
BASE_0=true

# Test for operating system and version
#
osrel=`uname -r`

sol_rel=`echo $osrel | nawk -F'.' ' { 
					if ( $1 >= 5  )
					{ num = $1 - 3 ;
					  printf num  "\." $2 ; 
					} }  ' 2>/dev/null`

case $osrel in
[52].[0-4]*)
	OPSYS=UNIX
	ANCIENT=true
	echo This software is incompatible with the OS version
	echo Exiting Installation
	exit
	;;
[52].*)
	OPSYS=Solaris
	ANCIENT=false
	;;
*)	echo "
Release $osrel of this OS has not been tested, do you wish to proceed? \c"
	ANCIENT=true
	if eval "$getyn"
	then
		break
	else
		exit 1
	fi
	;;
esac

#
# Query for installation options
#
termtype=${TERM:-"sun"}

TTYNAME="saip"
PRNAME="spr"  # not used

> /tmp/$MYNAME.inst
> /tmp/$MYNAME.inst.ed
CUST_INST=false

# If we detect PCI devices, we will ask to skip over the adapter
# identification stage
sai_pci=`prtconf | grep "pci114f,1c" | wc -l `   # Use Sun ID
sai_pci=`expr $sai_pci + 0`
if [ "$sai_pci" -gt 0 ] ; then
	[ ! "$sai_pci" = 1 ] && plural=s
	echo "
The installation has detected $sai_pci SunSAI/P serial adapter${plural}.

Would you like to automatically install the default configuration? \c"
	if eval "$getyn" ;  then
		SKIP_CONF=true
		nbrds=$sai_pci
		LN_TERM=yes
		USE_TTYMODES=1
		USE_INTERRUPTS=0
	else
		SKIP_CONF=false
		echo "\nWould you like to select your own instance numbers? (y/n)? \c"
		if eval "$getyn"
		then
			CUST_INST=true
		fi
	fi

else
	echo "
No adapters found.

Would you like to continue the configuration? \c"
	if eval "$getyn" ;  then
		SKIP_CONF=false
		nbrds=0
		LN_TERM=yes
		USE_TTYMODES=1
		USE_INTERRUPTS=0
		echo "\nWould you like to select your own instance numbers? (y/n)? \c"
		if eval "$getyn"
		then
			CUST_INST=true
		fi
	else
		exit 0
	fi
fi

ID1=
ID2=
IDLIST=

# If we are re-installing over top of ourselves, we will 
# assume that all the ttys are still available. This
# may be a dangerous way to proceed, if there are other 
# Digi products installed that use the same directories
# but the postremove script would delete them all anyway


if [ -f /kernel/drv/${MYNAME} -o -f /kernel/drv/sparcv9/${MYNAME} ] ; then

	if ls /dev/${TTYNAME}[a-z][01][0-9][0-9][ms] > /dev/null 2>&1 ; then
		echo "\nRe-using TTY device names from previous installation \n"
	fi
	IDLIST="a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
else
	for i in a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
	{
		if ls /dev/${TTYNAME}${i}[01][0-9][0-9][ms] > /dev/null 2>&1
		then
			ID2="${ID2} ${i}"
		else
			ID1="${ID1} ${i}"
		fi
	}

	IDLIST="${IDTMP}${ID1} "
fi

IDLIST1="$IDLIST"
IDLIST2="$IDLIST"

if [ "$SKIP_CONF" = "false" ] ; then
	echo "\nThis script installs the ${FULLNAME} driver :"

	echo "\n
This script also installs the information needed by ${OPSYS} to use
the additional ports available through this driver.  Depending upon 
your system, this driver may support up to ${MAX_NBRDS} Host Adapters and 
(0-${ZB_MAX_INST}) instances."

	echo "\n
Press <CR> to proceed or \"Q\" to quit: \c"

	read aa
	case $aa in
	[Qq])   exit 1
	;;
	esac


	LN_TERM=yes
	USE_TTYMODES=1


fi # SKIP_CONF

#
# Configuration loop
#
# Initialize variables
#
fepport=""
fepmem=""
nports=""
config=""

if [ "$SKIP_CONF" = "false" ] ; then
	#
	# Custom installation
	#
	echo "\nNOTE: Although (0-${ZB_MAX_INST}) instances are allowed, this driver"
	echo "only supports ${MAX_NBRDS} actual adapters at one time."
	echo "How many adapters do you wish to install (1-${MAX_NBRDS})? \c"

	while :
	do
		read nbrds
		[ ! "$nbrds" ] && nbrds=0
		if [ "$nbrds" -ge 1 -a "$nbrds" -le ${MAX_NBRDS} ] ; then
			break
		else
			echo "Please enter a number between 1 and ${MAX_NBRDS}: \c"
		fi
	done

fi # SKIP_CONF

tmpid=""
n=0
if [ "$CUST_INST" = "false" ] ; then
	cnt=0
fi

while [ "$n" -lt "$nbrds" ]
do
	iodisplay=""
	memdisplay=""

	if [ "$SKIP_CONF" = "false" ] ; then
		echo "\n Configuring adapter ${n}."
	fi

	#
	# Set up adapter type index variables N...
	# and corresponding printable strings P... 
	#
	if [ "$ARCH" = "sparc" ] ; then
		# Leave this stuff here, in case we start supporting
		# more adapters.  
		P0="99"; P1="99"; P2="99"; P3="99"; P4="99"; 
		P5="99"; P6="99"; P7="99"; P8="99"; P9="99"; 
		P10=" 0"; P11=" 1"; P12=" 2"; P13=" 3";

		N0=99; N1=99; N2=99; N3=99; N4=99; 
		N5=99; N6=99; N7=99; N8=99; N9=99; 
		N10=0; N11=99; N12=99; N13=99;
		MAXTYPE=0
	fi

	if [ "$ANCIENT" = "true" ] ; then
		P10="99"; P11="99"; P12="99"; P13="99";
		N10=99; N11=99; N12=99; N13=99;
		MAXTYPE=`expr $MAXTYPE - 4`
	fi

	BTYPE=A ; 
	BRDNAME="8-port PCI Async Intelligent Adapter"
	platform=PCI

	#
	# PCI Adapters
	#
	# No I/O port or memory asked for PCI
	porttmp=0
	memory=0
	conftmp="${conftmp} 0 0"
	memtmp="${memtmp} 0"

	xrconf

	if [ $? -eq 0 ]
	then
		fepmem="$fepmem $memtmp"
		config="$config $conftmp"
		fepport="$fepport $porttmp"
		eval BTYPE${n}=\$BTYPE
		eval bname${n}=\$BRDNAME
		eval fepmem$n="$memory"
		eval fepport$n="$porttmp"
		memtmp=""
		conftmp=""
		porttmp=""
		setok=1
	else
		memtmp=""
		conftmp=""
		porttmp=""
		memory=""
		echo "\nHit <CR> to re-configure adapter #${n}: \c"
		read aa
		setok=0
	fi

	eval altpin${n}=0
	if [ $setok -eq 1 ] ; then
		n=`expr $n + 1`
	fi
done

# this is new stuff that I added to export the variables to 
# the postinstall script
cat >>$1 <<!
MYNAME="$MYNAME"
MYPKGNAME="$MYPKGNAME"
BOARDNAME="$BOARDNAME"
SUN_OEM="$SUN_OEM"
TTYNAME="$TTYNAME"
PRNAME="$PRNAME"
INSTALLDIR=`pwd`
NBRDS=$nbrds
TTYNAME=$TTYNAME
PRNAME=$PRNAME
LN_TERM=$LN_TERM
USE_TTYMODES=$USE_TTYMODES
ANCIENT=$ANCIENT
BASE_0="$BASE_0"
!
n=0
while [ $n -lt "$nbrds" ]
do

	eval tmp=\$useint$n
	echo USE_INTERRUPTS${n}=$tmp >> $1
	eval tmp=\$bname$n
	echo BNAME${n}=$tmp >> $1
	eval tmp=\$altpin$n
	echo ALTPIN${n}=$tmp >> $1
	eval ALTPIN${n}=\$tmp
	eval tmp=\$fepmem$n
	echo FEPMEM${n}=$tmp >> $1
	eval tmp=\$fepport$n
	echo FEPPORT${n}=$tmp >> $1
	eval bt=\$BTYPE$n
	echo BTYPE${n}=$bt >> $1

	# Xem modules
	eval nconc=\$nconc${n}0
	eval nconc${n}=\$nconc
	echo NCONC${n}0=$nconc >> $1
	c=1
	while [ $c -le $nconc ]
	do
		eval id=\$id${n}0c${c}
		echo ID${n}0C${c}=$id >> $1
		eval pn=\$idn${n}0c${c}
		echo IDN${n}0C${c}=$pn >> $1
		eval tmp=\$nports$n${l}c$c
		if [ "$tmp" ] ; then  # This isn't always set
			echo NPORTS$n${l}C${c}=$tmp >> $1
		fi
		pn=`expr \( $pn - 1 \) \* 16 + 1`

		eval nm=\${nmod${n}${l}c${c}:=0}
		echo NMOD${n}${l}C${c}=$nm >> $1
		eval tmp=\$nports${n}0c${c}m0
		echo NPORTS${n}0C${c}M0=$tmp >> $1
		if [ "$nm" != 0 ]
			then
			m=1
			while [ $m -le $nm ]
			do
				eval id=\$id$n${l}c${c}m$m
				echo ID$n${l}C${c}M${m}=$id >> $1
				eval pn=\$idn$n${l}c${c}m$m
				echo IDN$n${l}C${c}M${m}=$pn >> $1
				eval tmp=\$nports$n${l}c${c}m$m
				echo NPORTS$n${l}C${c}M$m=$tmp >> $1
				pn=`expr \( $pn - 1 \) \* 16 + 1`

				m=`expr $m + 1`
			done
		fi

		c=`expr $c + 1`
	done

	n=`expr $n + 1`
done
#end of request script

# Main processing
ARCH=`uname -p`

# Set up driver suffix for unpacking.
case "$ARCH" in
	sparc)  
			PLAT_SUFFIX=cmn
			DL_DEV=saip
			DITTY=sitty
			DPA=spm
			SYSINCLUDE=saip.h
			if [ ! "$ANCIENT" = "false" ] ; then
				echo Sun SAI PCI drivers not supported on this platform
				echo Exiting Postinstall 
				exit 1
			fi
			;;
	*)	echo Could not recognize platform $ARCH
		exit 2 ;;
esac

# Use some unwanted keywords in the non-OEM version
MOV=`echo "m\c" ; echo "v"`
REM=`echo "r\c" ; echo "m"`
EXPLODE=`echo "unc\c" ; echo "ompress"`

# Test if we are installing overtop of ourselves.  If we are,
# then remove the drivers and kill the download daemon
##############################################################

if [ -f /kernel/drv/${MYNAME} -o -f /kernel/drv/sparcv9/${MYNAME} ] ; then
	echo "\nRemoving previous instance"

	# use ps 
	ps -ef | grep "${MYNAME}dl" > /dev/null
	[ $? = 0 ] && {
		pid=`ps -ef | grep ${MYNAME}dl | awk '{print $2}'`
		[ ! -z "$pid" ] && kill ${pid} 2>/dev/null
	}

	sleep 3  #  Give the ps time to finish
fi

sync
rem_drv ${MYNAME}dl 1>/dev/null 2>/dev/null
rem_drv ${MYNAME}   1>/dev/null 2>/dev/null
sync

##############################################################

#
# Now we're done asking questions.  Here is where the
# actual configuring starts to happen.
#

echo "\nConfiguring ${BOARDNAME} driver ... "
PORTS_PER_MOD=8
n=0
total=0
lasttotal=0

echo "\
#
# This file contains the values needed by the driver
# at load time.  For the most part the information can
# be changed without adverse affect. In order to reduce response 
# time to small packets (latency), it may be helpful to enable 
# interrupts on the adapter.  However, doing this will significantly 
# increase driver CPU usage on your Solaris system.  
# By default, interrupts are disabled.  
#
# Example: To enable interrupts on two SAI/P device with instance numbers of
#          zero and one, the entries in this file should look like:
#
#pci_saip_0_use_interrupts=1;
#pci_saip_1_use_interrupts=1;
#" > /tmp/${MYNAME}.conf
#dpz-trial#
${REM} -f /tmp/${MYNAME}dl.conf

XR_PCI_INDEX=0

n=0
old_pci_index=0
while [ $n -lt "$nbrds" ]
do
	# The reg_id field is used to differentiate between
	# different boards.  This value must be zero for
	# a memory address space, however, it also must
	# be unique to allow for sharing of memory addresses.
	# The workaround is to ignore the first register
	# set, and give it a bogus register value.  Then,
	# we can use the second register set for memory,
	# and apparently, Solaris doesn't check for that yet.
	reg_id=`expr $n \* 2 - 2`

	eval altn=\$ALTPIN$n
	NPORTS=$PORTS_PER_MOD
	eval fepsize="8000"
	eval FEPMEM=\$FEPMEM$n
	eval m=\$BTYPE$n
	family="saip"

# The auto-configuring adapters (PCI) need global variables in the
# configuration file.  This will make the variables easier to locate 
# since their instance numbers are as yet undefined. 
	pci_index_default=$XR_PCI_INDEX
	XR_PCI_INDEX=`expr $XR_PCI_INDEX + 1`
	pci_index=`grep "INST$n " /tmp/$MYNAME.inst.ed | cut -f2 -d' ' 2>/dev/null`
	if [ -z "$pci_index" ] ; then
		pci_index=$pci_index_default
		if [ $pci_index -lt $old_pci_index ] ; then
			pci_index=`expr $old_pci_index + 1`
		fi
	fi

	old_pci_index=$pci_index

	if [ $n -ge 0 ] ; then
		boardnum=$n
	else
		# flag an error and try to continue
		echo ERROR: bad board number
		boardnum=1
	fi
 
	eval tmp=\$useint$n
	eval tmpstring="pci_${family}_${pci_index}_use_interrupts=\${tmp}\;"
	echo $tmpstring >> /tmp/${MYNAME}.conf

#dpz-trial#
echo "name=\"saipdl\" parent=\"pseudo\" instance=$pci_index;" >> /tmp/${MYNAME}dl.conf

	n=`expr $n + 1`
done	

${REM} /tmp/${MYNAME}.cnt
${REM} /tmp/${MYNAME}.inst
${REM} /tmp/${MYNAME}.inst.ed

/usr/bin/chmod 644 /tmp/${MYNAME}.conf
${MOV} /tmp/${MYNAME}.conf /kernel/drv/${MYNAME}.conf
/usr/bin/chown root /kernel/drv/${MYNAME}.conf
/usr/bin/chgrp root /kernel/drv/${MYNAME}.conf
#dpz-trial#
/usr/bin/chmod 644 /tmp/${MYNAME}dl.conf
${MOV} /tmp/${MYNAME}dl.conf /kernel/drv/${MYNAME}dl.conf
	

sync
if [ $hw_exists = "1" ]; then
	# Hardware Present.  Modify system files and attach driver.
	#
	ADD_DRV="add_drv"
else
	# Hardware NOT Present.  Modify system files only.
	#
	ADD_DRV="add_drv -n"
fi
# Download driver gets loaded whether hdwr is present or not.
# (saipdl : download deamon won't start without it)
ADD_DLDRV="add_drv"

# Add driver.
${ADD_DRV} -m '* 0666 root sys','*cu 0600 uucp uucp' -i ' "pci114f,1c"  ' $MYNAME >/dev/null 2>&1

ADD_STATUS=$?
[ $ADD_STATUS != 0 ] && {
	echo Driver load did not succeed.  Package install continuing.
}

sync
# Add download driver.
${ADD_DLDRV} -m '* 0666 root sys','saip[0-9]* 0666 root sys','saip 0600 root sys' ${MYNAME}dl >/dev/null 2>&1
sync

/etc/rc2.d/S29$MYNAME start

echo "\nConfiguration Completed."
exit 0
