I have Apache installed on my Pi and I am trying to get it to be able to stop and start a service on the Pi from the web. I have created a cgi script and I am able to execute it and I know it works because there is some html code in it that displays. The issue I am having is getting the the service "<service name> start" to execute. The script is below.
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Starting Motion"
echo "<h1>Starting Motion</h1>"
echo "Starting $(service motion start)"
echo "</body></html>




