summaryrefslogtreecommitdiff
path: root/comms/minicom/scripts/create-dev-link
blob: a9c798ee98ce76a8e11bf2b8933a3a2160b187f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh -
#
# $NetBSD: create-dev-link,v 1.4 1998/08/07 10:36:44 agc Exp $
#
#	pre-install script for Minicom port to FreeBSD 2.x

echo ""
echo "Minicom will be installed mode 4511 (setuid) owner uucp, and group dialer."
echo ""
echo -n "Is this ok? [y] "
	read fooz
	if [ ! ${fooz} ] ; then
		fooz=Y
	fi
	if [ ${fooz} = Y -o ${fooz} = y -o ${fooz} = yes ] ; then
		# ok to continue
	else
		echo ""
		exit 1
	fi


echo ""
echo "Minicom needs to know what device your modem is hanging off of."
echo "I (the porter) have adopted Satoshi Asami's lead of using /dev/modem."
echo ""
echo -n "Lets see if you have too..."

# might want to test for ``-h'' rather than ``-e''
if [ -e /dev/modem ]; then
	echo "  Good you do:"
	/bin/ls -l /dev/modem
else
	echo "Nope, you haven't (yet)."
	echo "The patches to Minicom hardcode /dev/modem."
	echo -n "Would you like me to make this link for you? [Y] "
	read foo
	if [ ! ${foo} ] ; then
		foo=Y
	fi
	if [ ${foo} = Y -o ${foo} = y -o ${foo} = yes ] ; then
		echo "From the list below, what port number is your modem attached to?"
		cd /dev
		/bin/ls -C tty[0-9][0-9]
		echo ""
		echo -n "Enter the number X from ttyX above : "
		read bar
		if [ ${bar} ] ; then
			if [ -e /dev/tty${bar} ]; then
				ln -s /dev/tty${bar} /dev/modem
			else
				echo "Error: /dev/tty${bar} doesn't exist."
				exit 1
			fi
		fi
	fi
fi

echo ""
exit 0