Samantha (Femtech) wrote:
Hi List

Is there a cron that I con do to replace this, as the fx0 card doesnt hang up properly

phonegc:/home/samantha# asterisk -r
Asterisk CVS-05/30/03-17:17:07, Copyright (C) 1999-2001 Linux Support Services, Inc.
Written by Mark Spencer <[EMAIL PROTECTED]>
=========================================================================
Connected to Asterisk CVS-05 currently running on phonegc (pid = 15938)
phonegc*CLI> restart now
phonegc*CLI>
Disconnected from Asterisk server
phonegc:/home/samantha#

This should work. It doesn't check to see if asterisk is running and I haven't done any erro checking.

#!/usr/bin/expect

proc sleep {timeout} {
    expect
}
set send_slow   { 1 .05 }       ;# How fast to exp_send the characters

#log_user 1                     ;# Keeps the user from seeing the
                                ;# spawned the echo back.
if [catch "spawn asterisk -r" reason ] {
  exit 1
}

set id $spawn_id

expect "CLI>" { }                   ;# wait for a DOS prompt
exp_send -s -i $id "restart now\r"     ;# Write out the table
sleep 2
exit 0

# End of code

###############



--
Linux Home Automation         Neil Cherry        [EMAIL PROTECTED]
http://home.comcast.net/~ncherry/               (Text only)
http://linuxha.sourceforge.net/                 (SourceForge)
http://hcs.sourceforge.net/                     (HCS II)
_______________________________________________
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to