tak słyszeć słyszałem, próbowałem zrobić taki skrypt lecz pomimo nie wyskakiwania, żadnych błędów, proces i tak nie uruchamiał się.
Oto mój skrypt:
<?php
if(!isset($_GET['akcja'])) { <html>
<head>
<meta content="text/html; charset=iso-8859-2" http-equiv="content-type">
</head>
<body style="color: white; background-color: grey; font-family: Arial; font-size: 12px;" alink="#ffffff" link="#ffffff" vlink="#ffffff"><center>
<br>
<font size="5"><b>Serwer GTA SanAndreas Multiplayer</b></font><br>
<font size="4"><b></b></font><br>
<br><br>
<font size="4"><b>Opcje serwera:<br></b></font>
<a target="hide" href="samp.php?akcja=start"><font size="5"><b>Start</b></font></a><font size="5"><b> | </b></font>
<a target="hide" href="samp.php?akcja=stop"><font size="5"><b>Stop</b></font></a><br><br><br>
<iframe src="samp.php?akcja=brak" border="0" marginwidth="0" marginheight="0" name="hide" width="600" frameborder="no" height="100" scrolling="no"></iframe>
</center></body>
';
}
if(isset($_GET['akcja'])) { <html>
<head>
<meta content="text/html; charset=iso-8859-2" http-equiv="content-type">
</head>
<body style="color: white; background-color: grey; font-family: Arial; font-size: 12px;" alink="#ffffff" link="#ffffff" vlink="#ffffff"><center>
';
if($_GET['akcja'] == "start")
{
echo '<meta http-equiv="Refresh" Content="3; URL=samp.php?akcja=brak" /><font size="5"><b>Serwer zostal uruchomiony !</b></font>'; }
if($_GET['akcja'] == "stop")
{
echo '<meta http-equiv="Refresh" Content="3; URL=samp.php?akcja=brak" /><font size="5"><b>Serwer zostal wylaczony !</b></font>'; }
if($_GET['akcja'] == "brak")
{
}
</center></body>
';
}
?>
plik start.sh
#!/bin/bash
cd /var/samp
./samp03svr
done
oraz plik stop.sh
#!/bin/bash
killall -9 ./samp03svr
done
Czy jest to prawidłowe? Skrypt nie działa, niewiem dlaczego. Proszę o pomoc.
Proces do uruchomienia to ./samp03svr który jest w /var/samp
Skrypt służący do uruchamiania to samp.php i jest w /var/www/samp/samp.php