Liebe Mit-Brotfischer
Ich habe mich seit gestern an dieses kleine PHP-Script zum starten von einem SA:MP Server gesetzt, um nicht immer alles per konsole schreiben zu müssen.Wer sich besser damit auskennt, bitte einmal prüfen und mir sagen wo ich da einen fehler habe, denn per control.php?control=stop stoppt der Server zwar, dioch bei control.php?control=start wird er nicht gestartet. Liegt es an irgendwelche rechten? Ich nutze Debian Lenny 5.0 64Bit mit 32Bit Libaries.
Script:
PHP
<b>
<a href="?control=start" class="start">Start</a>
|
<a href="?control=restart" class="restart">Re-Start</a>
|
<a href="?control=stop" class="stop">Stop</a>
</b>
<br>
<?php
if(!isset($_GET['control'])) { $_GET['control'] = "none"; }
$dir = "/home/samp/mysql/";
if($_GET['control'] == "start")
{
shell_exec("sudo cd ".$dir);
shell_exec("sudo nohup samp03svr &");
}
if($_GET['control'] == "restart")
{
shell_exec("killall samp03svr");
shell_exec("cd ".$dir);
shell_exec("nohup samp03svr &");
}
if($_GET['control'] == "stop")
{
shell_exec("killall samp03svr");
}
?>
Alles anzeigen
Danke für jeden Hilfreichen Beitrag, SkEiTa!