Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-gps
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-gps
Commits
054ec863
Commit
054ec863
authored
Dec 05, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
0fe31330
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
logger_launcher.php
src/logger_launcher.php
+9
-11
No files found.
src/logger_launcher.php
View file @
054ec863
...
@@ -38,14 +38,14 @@
...
@@ -38,14 +38,14 @@
*!
*!
*/
*/
include
'
show_source.inc
'
;
include
'
include/show_source_include.php
'
;
//default parameters
//default parameters
$cmd
=
"start"
;
$cmd
=
"start"
;
$file
=
"/
usr/html/CF
/imu_log.log"
;
$file
=
"/
mnt/sda1
/imu_log.log"
;
$index
=
1
;
$index
=
1
;
$n
=
5000000
;
$n
=
5000000
;
$mount_point
=
"/
usr/html/CF
"
;
$mount_point
=
"/
mnt/sda1
"
;
$force_dev
=
false
;
$force_dev
=
false
;
...
@@ -72,11 +72,9 @@ if ($cmd=="start") {
...
@@ -72,11 +72,9 @@ if ($cmd=="start") {
//$dev = "/dev/hda1";
//$dev = "/dev/hda1";
if
(
!
$force_dev
)
{
if
(
!
$force_dev
)
{
$hda1
=
exec
(
"cat /proc/diskstats | grep 'hda1'"
);
$sda1
=
exec
(
"cat /proc/diskstats | grep 'sda1'"
);
$hdb1
=
exec
(
"cat /proc/diskstats | grep 'hdb1'"
);
if
(
strlen
(
$hda1
)
>
0
)
$dev
=
"/dev/hda1"
;
if
(
strlen
(
$sda1
)
>
0
)
$dev
=
"/dev/sda1"
;
else
if
(
strlen
(
$hdb1
)
>
0
)
$dev
=
"/dev/hdb1"
;
else
{
else
{
$xml
.=
"
\t
<error>CF cards not found</error>
\n
"
;
$xml
.=
"
\t
<error>CF cards not found</error>
\n
"
;
send_response
(
$xml
);
send_response
(
$xml
);
...
@@ -84,7 +82,7 @@ if ($cmd=="start") {
...
@@ -84,7 +82,7 @@ if ($cmd=="start") {
}
}
exec
(
"mount
$dev
$mount_point
"
);
exec
(
"mount
$dev
$mount_point
"
);
exec
(
"/usr/
local/
bin/log_imu
$file
$index
$n
>/dev/null 2>&1 &"
);
exec
(
"/usr/bin/log_imu
$file
$index
$n
>/dev/null 2>&1 &"
);
$xml
.=
"
\t
<result>ok</result>
\n
"
;
$xml
.=
"
\t
<result>ok</result>
\n
"
;
}
}
...
@@ -112,11 +110,11 @@ function send_response($xml){
...
@@ -112,11 +110,11 @@ function send_response($xml){
function
_help
(){
function
_help
(){
echo
"<pre>
\n
"
;
echo
"<pre>
\n
"
;
echo
"Usage example: 'http://192.168.0.9/logger_launcher.php?file=/
usr/html/CF/test.log&index=1&n=1000000&dev=/dev/hdb
1', where
\n
"
;
echo
"Usage example: 'http://192.168.0.9/logger_launcher.php?file=/
mnt/sda1/test.log&index=1&n=1000000&dev=/dev/sda
1', where
\n
"
;
echo
"'file'- log name (includes absolute path), '/usr/html/CF/' is the 'dev's mount point
\n
"
;
echo
"'file'- log name (includes absolute path), '/usr/html/CF/' is the 'dev's mount point
\n
"
;
echo
"'index'- index added to the log name
\n
"
;
echo
"'index'- index added to the log name
\n
"
;
echo
"'n'- max number of records in a single log file
\n
"
;
echo
"'n'- max number of records in a single log file
\n
"
;
echo
"'dev'- device name: '/dev/
hda1' or '/dev/hdb
1'
\n
"
;
echo
"'dev'- device name: '/dev/
sda
1'
\n
"
;
}
}
function
_usage
(){
function
_usage
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment