Znalazłem w sieci jeden panel serwera więc postanowiłem wyciąć z niego funkcję reset, lecz mam z nią problem ponieważ nie działa a jako że ja nie znam za bardzo się na CMD Shell wiec nic nie jestem w stanie zrobić.
Plik restart.php:
Kod
<?
$path = "/var/www/";
echo 'Serwer zrestartowany!';
system(''.$path.'control.sh restart >/dev/null');
?>
$path = "/var/www/";
echo 'Serwer zrestartowany!';
system(''.$path.'control.sh restart >/dev/null');
?>
Plik control.sh:
Kod
#!/bin/bash
server_start() {
/var/www/123sam.sh & # put in full path and name of startup script
}
server_stop() {
killall 123sam.sh # your startup script name
killall samp02Xsvr # need to put in path to killall if its not in $PATH
}
server_restart() {
server_stop
sleep 3s
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "Usage $0 start|stop|restart"
esac
server_start() {
/var/www/123sam.sh & # put in full path and name of startup script
}
server_stop() {
killall 123sam.sh # your startup script name
killall samp02Xsvr # need to put in path to killall if its not in $PATH
}
server_restart() {
server_stop
sleep 3s
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "Usage $0 start|stop|restart"
esac
Plik 123sam.sh:
Kod
#!/bin/bash
while true; do
if pgrep samp02Xsvr &>/dev/null; then
echo Blad - Duplikacja procesu!
exit
else
cd /root/samp02X/
./samp02Xsvr
fi
sleep 15m
done
while true; do
if pgrep samp02Xsvr &>/dev/null; then
echo Blad - Duplikacja procesu!
exit
else
cd /root/samp02X/
./samp02Xsvr
fi
sleep 15m
done
Katalogi są w porządku i wszystko lecz nie wiem dlaczego to nie działa


Lub jeśli posiada ktoś komendę na restart serwera prosił bym

PS dopowiem ze tych serwerów będzie kilka a więc restart po nazwie nic nie da...
Pozdrawiam
