I've a small project allmost finished. In it, I use some .cgi files in which I make communication between a microcontroler and a webserver. The problem is the following:
If I use this code the project works fine:
#!/bin/bash
./moveRight
echo "Status: 204 No Content"
echo "Content-type: text/html"
echo ""
but when I use tjis code, nothing happens:
#!/bin/bash
mkdir /tmp/stream
raspistill --nopreview -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 &
chmod 777 /dev/ttyAMA0
LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -p 8080 -w /var/www" &
echo "Status: 204 No Content"
echo "Content-type: text/plain"
echo ""
What I want is to execute those bash commands when the .cgi is called, do you think what can be my problem? Or any workaround for this issue?
EDIT: ./moveRight is a compiled c program which moves a motor. I have two different .cgi. The first one moves the motor correctly but the second one is supposed to execute some shell commands but when it's called, nothing happens.
Thank you!!