Thanks to those who tried to help.
$ip = ‘xx.xx.xx.xx’;
$serverip = str_replace(“\n”,””,shell_exec(“ifconfig eth0 | grep ‘inet
addr’ | awk -F’:’ {‘print $2′} | awk -F’ ‘ {‘print $1’}”)); if
($serverip != $ip) {die(‘WRONG SERVER IP’);}
solved php code to check IP address and stop script [closed]