LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Conky Script-Output Problem (http://www.linuxquestions.org/questions/linux-general-1/conky-script-output-problem-724907/)

ganimo 05-09-2009 05:08 PM

Conky Script-Output Problem
 
1 Attachment(s)
Hi Friends,
yesterday i installed the little system-monitoring-tool conky, which works great!
I wrote a little bash-script to show my current WAN-IP and added this script in the conky.config:

Script:
Quote:

#!/bin/bash
cd /tmp
wget -q checkip.dyndns.org && cat index.html |grep -Eo 'Current IP Address:*.*.*.*'|sed 's/<\/body><\/html>/ /'
rm index.html
Line in conky.config:
Quote:

${color #00ff00}${execi 300 /home/ganimo/sec/scripts/bash/ip.sh}
i restarted conky and the script worked, but after the IP-Address is also a little square:Attachment 571

How can i remove this? when i start the script in a shell, this square is not there?
I would be thankful for every answer.
ganimo

senseproof 05-09-2009 06:40 PM

I don't know this conky program you mean but I did your sed script on that page:

Code:

[jon@jaydee Development]$ wget -q -O - checkip.dyndns.org | grep -Eo 'Current IP Address:*.*.*.*'| sed 's/<\/body><\/html>/ /'
Current IP Address: 82.132.136.207
[jon@jaydee Development]$ wget -q -O - checkip.dyndns.org | grep -Eo 'Current IP Address:*.*.*.*'| sed 's/<\/body><\/html>/ /' | od -t x1a
0000000 43 75 72 72 65 6e 74 20 49 50 20 41 64 64 72 65
          C  u  r  r  e  n  t  sp  I  P  sp  A  d  d  r  e
0000020 73 73 3a 20 38 32 2e 31 33 32 2e 31 33 36 2e 32
          s  s  :  sp  8  2  .  1  3  2  .  1  3  6  .  2
0000040 30 37 20 20 0a
          0  7  sp  sp  nl
0000045

There are two spaces and a linefeed on the end of the line. Maybe that is the problem?

Code:

[jon@jaydee Development]$ echo -n Current IP Address: `wget -q -O - checkip.dyndns.org | sed 's/^.*Address: \([^<]\{1,\}\)<.*/\1/'` | od -t x1a
0000000 43 75 72 72 65 6e 74 20 49 50 20 41 64 64 72 65
          C  u  r  r  e  n  t  sp  I  P  sp  A  d  d  r  e
0000020 73 73 3a 20 38 32 2e 31 33 32 2e 31 33 36 2e 32
          s  s  :  sp  8  2  .  1  3  2  .  1  3  6  .  2
0000040 30 37
          0  7
0000042

Try that...

If you have a uPnP router you could ask it for your IP instead.

ganimo 05-10-2009 07:15 AM

Great! It works!
Thank you very much senseproof! You Script works beautiful! Great work!
Now this square isnt there anymore!
ganimo


All times are GMT -5. The time now is 11:06 AM.