tet@uvaee.UUCP (Thomas E. Tkacik) (11/06/85)
One problem with the PC7300 concerns the phone lines. If there is only one phone line available, then it must be configured as a VOICE line, or the computer will start to answer phone calls not intended for it, (to the dismay of the caller). However, to use uucp, the phone line must be configured as a DATA line, or the connection will not be made. Up until now, this had to be done manually, making it impossible for cron to do its thing at wee hours of the morning. The enclosed shell script will automatically change the phone line to a DATA line, allow a phone call to be made, and then change it back at the end of the session. To use this, phone 2 must be configured as a DATA line using the window manager, and the phone connected to line 2, leaving line 1 empty. This is apparently due to the extreme control ph has over line 1. Then using the phone manager, (the CALL button), the line is switched to a VOICE line, and can then be used. The shell script works by using three of the phone configuration files and sending the phone manager (ph) a signal to change to the proper configuration. The files are: 1) /etc/.linetwo contains the phone configuration 2) /usr/lib/ua/phnum contains the command to execute of the signal 3) /usr/lib/ua/phpid containd the pid of the ph command THIS PROGRAM MUST BE OWNED AND OPERATED BY ROOT. IT CAN BE ADDED TO CRONTAB AS IS. The same program can be used for cu as well, but again it must be owned and operated by root. Complaints, comments and compliments (but no flames) are always welcome. Tom Tkacik ...!decvax!mcnc!ncsu!uvacs!uvaee!tetnix!tet (home) ...!decvax!mcnc!ncsu!uvacs!uvaee!tet (office) #--------------------cut on the dotted line------------------------# # this shell script will change phone line 2 to a data line and poll # all known computers for uucp transfers # # change the phone line to a data line # echo "1s/VOICE/DATA\nw\nq\n" | ed /etc/.linetwo > /dev/null echo "Admin" > /usr/lib/ua/phnum # # generate the kill command # this would be easier if echo did not always add a newline at the end ( cat /usr/lib/ua/phpid ; echo) > /tmp/phone echo "1s/^/kill -17 \nw\nq\n" | ed /tmp/phone > /dev/null # send a signal to the ph command - will cause ph to reconfigure the phone sh /tmp/phone # # wait 10 seconds for the phone line to change sleep 10 # # poll all known machines /usr/lib/uucp/uucico -r1 # # now put the line back to a voice line echo "1s/DATA/VOICE\nw\nq\n" | ed /etc/.linetwo > /dev/null echo "Admin" > /usr/lib/ua/phnum sh /tmp/phone sleep 10 echo "Logout" > /usr/lib/ua/phnum rm /tmp/phone