Unverified Commit fa7bb475 authored by David Beniamine's avatar David Beniamine
Browse files

Put all ligne in registry

parent 967b768e
......@@ -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)
sline=$(echo $line | cut -d ' ' -f 1-2)
res=$(grep "$sline" $conf_file)
if [ ! -z "$res" ]
then
# Update
sed -i -e "s/^.*$line$/$date $line/" $conf_file
sed -i -e "s/^.*$sline$/$date $line/" $conf_file
else
# Add
echo "$date $line" >> $conf_file
......
......@@ -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">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment