Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[Un peu HS] Affcher l'adresse IP sous SuperKaramba

1 réponse
Avatar
Cyrille Maiche
Bonsoir

J'utilise un thème de superkaramba et je voudrais afficher mon IP mais ça ne
marche pas

Voici la ligne qui doit donner l'IP

text x=80 y=200 sensor=program program="/sbin/ip addr show eth0 | grep 'inet ' |
cut -d t -f2 | cut -d / -f1 | cut -b 2-" color=255,255,255 font="Neuropol"
fontsize=11

J'ai aussi trouvé un autre petit programme que voici

#!/usr/bin/perl

$net = `/sbin/ifconfig | grep 'eth0'`;
if (length($net))
{
$net = `/sbin/ifconfig eth0 | grep 'inet addr'`;
if (!length($net))
{
$net = `/sbin/ifconfig eth0 | grep 'inet end.'`;
}
if (length($net))
{
chop($net);
@netip = split/:/,$net;
$netip[1] =~ /(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/;
$ip = $1 .".". $2 .".". $3 .".". $4;
print "". $ip ."\n";
}
else
{
print "Not Found\n";
}
}
else
{
print "Error\n";
}

La première ligne me donne l'adresse mac de ma carte réseau mais rien pour les
autres ligne de recherche avec ifconfig.

Je voudrais bien un peu d'aide si quelqu'un a une idée sur ce petit problème.

merci


--
Cyrille Maiche

Debian Etch 2.6.15

------------------------------------
http://clcr94.clg.ac-creteil.fr
------------------------------------


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs "From" et
"Reply-To:"

To UNSUBSCRIBE, email to debian-user-french-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

1 réponse

Avatar
Cyrille Maiche
Je me répond

j'ai trouvé cette ligne qui marche !!

text x5 yU sensor=program program="/sbin/ifconfig eth0 | grep 'inet ' | cut
-d : -f2 | cut -d ' ' -f1" color%5,180,0 fontsize=9 font="Verdana"

Cyrille Maiche a écrit :
Bonsoir

J'utilise un thème de superkaramba et je voudrais afficher mon IP mais
ça ne marche pas

Voici la ligne qui doit donner l'IP

text x€ y 0 sensor=program program="/sbin/ip addr show eth0 | grep
'inet ' | cut -d t -f2 | cut -d / -f1 | cut -b 2-" color%5,255,255
font="Neuropol" fontsize

J'ai aussi trouvé un autre petit programme que voici

#!/usr/bin/perl

$net = `/sbin/ifconfig | grep 'eth0'`;
if (length($net))
{
$net = `/sbin/ifconfig eth0 | grep 'inet addr'`;
if (!length($net))
{
$net = `/sbin/ifconfig eth0 | grep 'inet end.'`;
}
if (length($net))
{
chop($net);
@netip = split/:/,$net;
$netip[1] =~ /(d{1,3}).(d{1,3}).(d{1,3}).(d{1,3})/;
$ip = $1 .".". $2 .".". $3 .".". $4;
print "". $ip ."n";
}
else
{
print "Not Foundn";
}
}
else
{
print "Errorn";
}

La première ligne me donne l'adresse mac de ma carte réseau mais rien
pour les autres ligne de recherche avec ifconfig.

Je voudrais bien un peu d'aide si quelqu'un a une idée sur ce petit
problème.

merci






--
Cyrille Maiche

Debian Etch 2.6.15

------------------------------------
http://clcr94.clg.ac-creteil.fr
------------------------------------


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs "From" et
"Reply-To:"

To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact