From 3bb53e27c7e1c0aaab89bf95ca3ea5ecf3a8e41f Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 5 Aug 2003 12:58:38 +0000 Subject: [PATCH] script to handle setting permissions, etc for serial --- build/macosx/dist/serial_setup.command | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 build/macosx/dist/serial_setup.command diff --git a/build/macosx/dist/serial_setup.command b/build/macosx/dist/serial_setup.command new file mode 100755 index 000000000..b5d93eba7 --- /dev/null +++ b/build/macosx/dist/serial_setup.command @@ -0,0 +1,51 @@ +#!/bin/sh + +# originally fixperm.sh from rxtx-2.1_6/contrib +# with a couple additions from pathsetup.command from fink [fry] + +# A script to fix permissions for lock files on Mac OS X +# Contributed by Dmitry Markman +# Fri Aug 23 15:46:46 MDT 2002 + +echo "" +echo "" +echo "This command will take care of a couple system things" +echo "so that you can properly use the serial port to communicate" +echo "between hardware devices and processing." +echo "" +echo "If there are actually changes that need to be made, then" +echo "enter your password when prompted. The command uses sudo," +echo "and you'll need to have administrator access." +echo "" + +echo -n "Do you want to continue? [Y/n] " +read answer +answer=`echo $answer | sed 's/^[yY].*$/y/'` +if [ -z "$answer" -o "x$answer" = "xy" ]; then + curruser=`sudo id -p | grep 'login' | sed 's/login.//'` + + if [ ! -d /var/spool/uucp ] + then + sudo mkdir /var/spool/uucp + fi + + sudo chgrp uucp /var/spool/uucp + sudo chmod 775 /var/spool/uucp + + if [ ! `sudo niutil -readprop / /groups/uucp users | grep $curruser > /dev/null` ] + then + sudo niutil -mergeprop / /groups/uucp users $curruser + fi + + echo "Finished making changes, you should be all set" +else + echo "Ok, nevermind then." +fi + +echo "" +echo "" +echo " (All done... you can close this window now)" +echo "" +echo "" +echo "" +