#!/bin/bash
## Example serial driver startup script for use with 16 port pci-x card
## note: if you modify the driver and/or setserial configs, you don't
## have to run this.  Also note that setserial is require to use this script.
	
PATH=/sbin:/usr/sbin:/bin:/usr/bin

## Add options if you would like, but autoconfig should work
SSOPTS="autoconfig"

## Check to see if the required two arguments are supplied.
if [ $# -ne 3 ]
then
	echo
        echo "Usage: $0 PORTNUM IRQADDRESS BASEBAUD"
	echo
	exit 0
fi

	PORT=$(( $1 + 0 ))
	IRQ=$(( $2 + 0 ))
	BAUD=$(( $3 + 0))

	
## Simply tell the serial driver where the I/O ports are located...
for ((i = 0; i < 16; i++))
do
	setserial /dev/ttyS$i port $PORT irq $IRQ ${SSOPTS} baud_base $BAUD
	PORT=$((PORT + 8))
done
