Skip to content
Snippets Groups Projects
Verified Commit 6293f9f8 authored by David Beniamine's avatar David Beniamine
Browse files

Remove ip from line

parent fa7bb475
Branches
Tags
No related merge requests found
...@@ -47,11 +47,12 @@ do ...@@ -47,11 +47,12 @@ do
date=$(date +%Y%m%d) date=$(date +%Y%m%d)
rIP=$(echo $line | cut -d ' ' -f 3) rIP=$(echo $line | cut -d ' ' -f 3)
sline=$(echo $line | cut -d ' ' -f 1-2) sline=$(echo $line | cut -d ' ' -f 1-2)
eline=$(echo $line | cut -d ' ' -f 4-)
res=$(grep "$sline" $conf_file) res=$(grep "$sline" $conf_file)
if [ ! -z "$res" ] if [ ! -z "$res" ]
then then
# Update # Update
sed -i -e "s/^.*$sline$/$date $line/" $conf_file sed -i -e "s/^.*$sline.*$/$date $sline $eline/" $conf_file
else else
# Add # Add
echo "$date $line" >> $conf_file echo "$date $line" >> $conf_file
......
...@@ -79,18 +79,19 @@ if(!isset($action)){ ...@@ -79,18 +79,19 @@ if(!isset($action)){
foreach($lines as $line){ foreach($lines as $line){
if($line != ""){ if($line != ""){
$entry=explode(' ', $line); $entry=explode(' ', $line);
$nb_infos=count($entry);
array_push($registry, $entry); array_push($registry, $entry);
# Format date mac name ip [num_apt_upgrade deb_version pt_version git_branch git_update] # Format date mac name [num_apt_upgrade deb_version pt_version git_branch git_update] ip
echo "<tr>"; echo "<tr>";
echo "<td>".$entry[2]."</td>"; echo "<td>".$entry[2]."</td>";
echo "<td> ".$entry[3]."</td>"; echo "<td> ".$entry[$nb_infos-1]."</td>";
echo "<td>".$entry[1]."</td>"; echo "<td>".$entry[1]."</td>";
#echo "<td>".$entry[0]."</td>"; #echo "<td>".$entry[0]."</td>";
if(count($entry) > 4){ if($nb_infos > 4){
echo "<td>".$entry[4]."</td>";
echo "<td>".$entry[5]."</td>"; echo "<td>".$entry[5]."</td>";
echo "<td>".$entry[6]."</td>"; echo "<td>".$entry[3]." mises à jour en attente</td>";
echo "<td>".$entry[4]." mises à jour en attente</td>"; echo "<td> branch ".$entry[6]." ".$entry[7]." commits en retard</td>";
echo "<td> branch ".$entry[7]." ".$entry[8]." commits en retard</td>";
}else{ }else{
echo "<td>NA</td>"; echo "<td>NA</td>";
echo "<td>NA</td>"; echo "<td>NA</td>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment