im trying to get my php script to run expect like so....
here is a copy of the reconstruct_mailbox.sh
if($_GET["action"]=="reconstruct" && isset($_POST["username"]))
$string = shell_exec("expect /home/scripts/reconstruct_mailbox.sh ".$_POST["username"]);
the expect script is working i have tested it in terminal
#! /usr/bin/expect -f
set username [lindex $argv 0]
spawn su timgolding
send "sudo su cyrus\r"
send "/usr/bin/cyrus/bin/reconstruct -r user/$username\r"
Im not sure if the php will be working because it was only outputting this
its as though it only got to "recon" and did it finish that line of code. Its annoying it was the last line of coed in the script. How can i tell. Is there some sort of a timeout i can set to get it to wait a little longer for output? Any ideas?
spawn su timgolding Password: mail:/Volumes/Files/webmaster/cyrus-admin/web timgolding$ sudo su cyrus Password: mail:/Volumes/Files/webmaster/cyrus-admin/web cyrus$ /usr/bin/cyrus/bin/recon