#!/bin/sh -e

# Script borrowed from the pilot-link package

defport="ttyS1"

echo ""
echo "Which serial port you'd like to use for connecting to your Newton device?"
echo "(A symbolic link /dev/newton will be set up to point to that device)"
echo "ttyS0 - COM1"
echo "ttyS1 - COM2"
echo "ttyS2 - COM3"
echo "ttyS3 - COM4"
echo "default is $defport"
echo -n "> "
read answer
if [ -n "$answer" ]
then
   port="/dev/$answer"
else
   port="/dev/$defport"
fi

echo "/dev/newton is now pointing to $port"

# Set up a link for /dev/newton to point to the serial port
rm -f /dev/newton
ln -s $port /dev/newton

exit 0
