Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Grenoble
Eole-Wol
Commits
fa7bb475
Unverified
Commit
fa7bb475
authored
Aug 05, 2019
by
David Beniamine
Browse files
Put all ligne in registry
parent
967b768e
Changes
2
Hide whitespace changes
Inline
Side-by-side
registry/scripts/registry.sh
View file @
fa7bb475
...
...
@@ -46,12 +46,12 @@ do
then
date
=
$(
date
+%Y%m%d
)
rIP
=
$(
echo
$line
|
cut
-d
' '
-f
3
)
line
=
$(
echo
$line
|
cut
-d
' '
-f
1-2
)
res
=
$(
grep
"
$line
"
$conf_file
)
s
line
=
$(
echo
$line
|
cut
-d
' '
-f
1-2
)
res
=
$(
grep
"
$
s
line
"
$conf_file
)
if
[
!
-z
"
$res
"
]
then
# Update
sed
-i
-e
"s/^.*
$line$/$date
$line
/"
$conf_file
sed
-i
-e
"s/^.*
$
s
line$/$date
$line
/"
$conf_file
else
# Add
echo
"
$date
$line
"
>>
$conf_file
...
...
wol/www/index.php
View file @
fa7bb475
...
...
@@ -35,7 +35,22 @@ extract($_POST);
if
(
!
isset
(
$action
)){
$lines
=
explode
(
PHP_EOL
,
shell_exec
(
"../scripts/get_registry.sh"
));
?>
<p>
<?php
echo
count
(
$lines
);
?>
postes sont inscrits sur ce serveur
</p>
<p>
<?php
$n
=
count
(
$lines
);
if
(
empty
(
$lines
)){
echo
"Impossible de récupérer le registre"
;
ob_start
();
shell_exec
(
"../scripts/get_registry.sh"
);
$lines
=
ob_get_clean
();
echo
"
$lines
"
;
}
else
if
(
$n
==
1
){
echo
"
$n
poste est enregistré sur ce serveur"
;
}
else
{
echo
"
$n
postes sont enregistrés sur ce serveur"
;
}
?>
</p>
<h2>
Actions globables
</h2>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"upgradeAll"
>
...
...
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