|
Posted by Henk Oegema on 10/09/07 18:15
In the php script below I use 3 variables:
1. &day
2. $hour
3. $minute.
Filename:/opt/lampp/htdocs/uptime/uptime.php
<?php
###########################################################################
# #
# Copyright © http://www.4webhelp.net/ #
# Neither http://www.4webhelp.net/ nor its members accept any #
# responsibility, either expressed or implied, for any damage caused by #
# using this script or the misuse of this script. #
# #
# Adapted for Asterisk PBX by Henk Oegema #
# #
# INSTRUCTIONS #
# #
# 1) Copy this code to an editor such as Notepad and save it with a #
# .php extension. #
# 2) FTP this file to a folder on your site in ASCII mode #
# 3) Call up this file in your web browser to see your server's uptime #
# #
###########################################################################
$data = shell_exec('uptime');
$uptime = explode(' up ', $data);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].' ' .$uptime[1];
$days = explode(' ', $uptime);
$hours = explode(':', $days[3]);
$day = $days[0];
$hour = $hours[0];
$minute = $hours[1];
?>
Question: How to I pass those 3 variables from the script, to 3 variables in
Linux (Debian).
Something like:
asterisk:~# day=${CURL(http://localhost/uptime/uptime.php)} (?????)
asterisk:~# hour=...........
asterisk:~# minute=.........
Navigation:
[Reply to this message]
|