Call a shell script from php?
I have a shell script named "start" that starts a gameserver for me:
#!/bin/sh start=`date '+%H:%M on %d/%m/%y'` echo "CoD UO Match server started @ $start" >>/usr/servers/coduomatch1/CoDUOMatch1.log screen -A -m -d -S CoDUOMatch1 ./coduo_lnxded +set net_port 28965 +exec coduo_sd.cfg +set sv_cheats 0 +map_rotate +set fs_homepath /usr/servers/coduomatch1 +set fs_basepath /usr/servers/coduomatch1 >/dev/null 2>&1 & echo $! >CoDUOMatch1.pid I would like to make a simple web page with a button on it to call this script. I can't seem to find any info on how to do this using my usual search methods. Can someone point me in the right direction? |
I don't know if php will success with screen program, anyway try :
make a form with action="script.php" And for script.php : PHP Code:
|
Use passthru() function it replaces both exec() and system(). It will execute shell script (or other program( and display raw output to your interface. Better read http://in2.php.net/manual/en/function.passthru.php
|
All times are GMT -5. The time now is 04:32 AM. |