$NetBSD: patch-ag,v 1.5 2004/07/10 23:45:59 salo Exp $ --- install.sh.orig 2003-12-16 17:54:55.000000000 +0100 +++ install.sh 2004-07-11 01:44:38.000000000 +0200 @@ -17,7 +17,7 @@ # Files: x10config x10sched.conf FOUND= for FL in $X10CONFIG $HOME/.x10config /etc/x10.conf ; do -if [ -e $FL ] ; then +if [ -f $FL -o -h $FL ] ; then FOUND=$FL echo "An X10 Configuration file was found at $FL" break @@ -28,7 +28,7 @@ while : ; do echo "Where would you like the sample X10 configuration installed?" echo "The default is $HOME/.x10config" - read WHERE + WHERE=${PREFIX}/share/examples/heyu/x10config if [ "$WHERE" = "" ] ; then FOUND=$HOME/.x10config break @@ -56,14 +56,9 @@ ;; esac echo "To which port is the CM11 attached?" - read WHERE - if [ "$WHERE" != "" ] ; then - if [ -e $WHERE ] ; then + WHERE=$DEFAULT_SERIAL_DEVICE TTY=$WHERE break - fi - echo "I could not find the device you specified. Please try again." - fi done sed "s;^TTY.*;TTY $TTY;" x10config > $FOUND @@ -71,29 +66,22 @@ echo "X10 configuration file at $FOUND will be used." -eval `sed -n "s/^TTY[ ]*/TTY=/p" $FOUND ` -if [ "$TTY" = "" ] ; then - eval `sed -n "s/^OPTION[ ]*TTY[ ]*/TTY=/p" $FOUND ` -fi - -#Check TTY permisions -set `ls -l $TTY` none -if [ $1 = "none" ] ; then - echo "fatal error: The TTY device $TTY can not be located" - exit -fi +if [ -c $TTY -o -h $TTY ]; then + eval `sed -n "s/^TTY[ ]*/TTY=/p" $FOUND` -if [ "$1" != crwxrwxrwx ] ; then - if [ "$ME" != root ] ; then + #Check TTY permisions + set `ls -l $TTY` none + if [ $1 = "none" ] ; then + echo "WARNING: The TTY device $TTY can not be located" + else + if [ "$1" != crwxrwxrwx ] ; then echo "If you want users other than root to be able to run HEYU, " echo "you'll have to log in as root and run the command \"chmod 777 $TTY\"" else - chmod 777 $TTY - fi -else echo "The TTY permissions were OK." + fi + fi fi - # Directories: spool and lock # get the lockdir and spooldir compile options by using the hidden option 'list' eval `./heyu list`