It is currently Tue, 07 Dec 2021 03:44:31 GMT



 
Author Message
 How to redirect from dialer-script to stdout?

Hi all,

I am tech support at an ISP. I want to give support to linux-users.
So I set up linux 2.0.29 on my machine at home(private) and wrote
some scripts to dial into our server. The scripts works good.
  The problem is, that I get no output to stdout(console or xterm).
I added some commands to do this (echo "blah,blah..." > /dev/console).
That works fine till the chat programm is started. The echo's goes to
anywhere but not to stdout. What's wrong?
Here are the scripts:

__________________________________________________________________________
ppp-on:
#!/bin/sh
# /etc/ppp/ppp-on
# ppp-on Script zum Aufbauen der ppp-Verbindung
#
TELEPHONE=12345678                # Telefonnummer zum {*filter*}net-server
LOCAL_IP=0.0.0.0                  # Lokale IP-nummer; Dynamisch =
0.0.0.0
REMOTE_IP=0.0.0.0                 # Server IP-adresse; nicht n?tig
DEVICE=/dev/ttyS1
#NETMASK=255.255.255.0            # netzwerkmaske, falls n?tig(z.B. im
LAN)
export TELEPHONE                  # Variable fr ppp-on-dialer verfgbar
machen
#
DIALER_SCRIPT=/etc/ppp/ppp-on-dialer   # chat Script
#
#Initialisieren der Verbindung:
#
echo "Verbindung zu {*filter*}net wird aufgebaut..." > /dev/console

exec /usr/sbin/pppd /dev/modem 38400 $LOCAL_IP:$REMOTE_IP connect
$DIALER_SCRIPT
#this don't work:
if $errlvl != 0
   echo "Fehler beim Verbinden! Abbruch" > /dev/console
   goto end
if $errlvl = 0
   echo "Verbunden mit {*filter*}net bei 14400 BPS." > /dev/console

________________________________________________________________________________

ppp-on-dialer:
#!/bin/sh
# /etc/ppp/ppp-on-dialer
# ppp-on-dialer Script fr chat (zum Aufbauen der Modemverbindung)
#
echo "W?hle 12345678..." > /dev/console  #this works

 /usr/sbin/chat                                   \
     TIMEOUT          3                             \
     ABORT            '\nBUSY\r'                    \
     ABORT            '\nNO ANSWER\r'               \
     ABORT            '\nNO DIALTONE\r'             \
     ABORT            '\nRING\r\n\r\nRING\r'        \
     ''               '+++ATZ'                      \
     OK               'AT&F0E0'                     \
     TIMEOUT          30                            \
     OK               ATDP$TELEPHONE                \
     CONNECT          ''                            \
     TIMEOUT          30

#this don't work:
case $? in
   0) echo "berprfe Username und Passwort" > dev/console; exit 0;;
   1) echo "Falsche Parameter oder Parametergr??e! Abbruch!" >
dev/console; exit 1;;
   2) echo "Fehler beim Ausfhren von chat! Abbruch!" > dev/console;
exit 2;;
   3) echo "Unerwartetes Ereigniss!" > /dev/console; exit 3;;
   4) echo "Leitung belegt! Abbruch!" > /dev/console; exit 4;;
   5) echo "Modem reagiert nicht! Abbruch!" > /dev/console; exit 5;;
   6) echo "Kein W?hlton! Abbruch!" > /dev/console; exit 6;;
   7) echo "Eingehender Anruf! Abbruch!" > /dev/console; exit 7;;
esac

If anybody post an answer, please send it to me too:
cc:tlin...@{*filter*}net-ag.de  

Thanks, Thomas



 Thu, 02 Mar 2000 03:00:00 GMT   
 
   [ 1 post ] 

Similar Threads

1. Problem redirecting stderr+stdout in rsh script

2. redirect STDOUT in telnet script

3. Apache kills CGI script after redirecting or closing STDOUT

4. redirecting STDOUT of a bg process to STDOUT of a new xterm

5. runtime stdout redirect.

6. redirecting stdout to file over NFS slows dramatically

7. redirected stdout?

8. Problem redirecting stdout to pipes/files

9. how to bash redirect stdout stderr without buffering

10. Redirecting the stdout of a running process?


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software