site checking stuff

This commit is contained in:
redmatrix
2015-09-14 19:16:25 -07:00
parent 8fb4f37670
commit 97b990c9bf
3 changed files with 74 additions and 3 deletions

View File

@@ -291,13 +291,18 @@ function ping_site($url) {
$ret['message'] = 'no answer from ' . $url;
return $ret;
}
$packet_result = $r['body'];
$packet_result = json_decode($r['body'],true);
if(! $packet_result['success']) {
$ret['message'] = 'packet failure from ' . $url;
return $ret;
}
$ret['success'] = true;
return $ret;
if($packet_result['success']) {
$ret['success'] = true;
}
else {
$ret['message'] = 'unknown error from ' . $url;
}
return $ret;
}