LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-09-2009, 05:08 PM   #1
ganimo
LQ Newbie
 
Registered: Feb 2009
Location: Nürnberg Germany
Distribution: Debian 5.0, Ubuntu 8.10
Posts: 17

Rep: Reputation: 2
Conky Script-Output Problem


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:Click image for larger version

Name:	Bildschirmfoto.jpg
Views:	48
Size:	50.9 KB
ID:	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
 
Old 05-09-2009, 06:40 PM   #2
senseproof
Member
 
Registered: May 2009
Distribution: Fedora 10
Posts: 31
Blog Entries: 5

Rep: Reputation: 16
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.

Last edited by senseproof; 05-09-2009 at 06:45 PM. Reason: added Current IP Address: for him
 
Old 05-10-2009, 07:15 AM   #3
ganimo
LQ Newbie
 
Registered: Feb 2009
Location: Nürnberg Germany
Distribution: Debian 5.0, Ubuntu 8.10
Posts: 17

Original Poster
Rep: Reputation: 2
Great! It works!
Thank you very much senseproof! You Script works beautiful! Great work!
Now this square isnt there anymore!
ganimo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with output from script kaplan71 Linux - Software 3 01-13-2009 04:14 PM
conky not showing all output wilsid Linux - Software 0 06-05-2008 03:54 PM
problem receiving output from Expect script slinx Linux - Software 4 04-30-2008 08:02 AM
grep and assign it's output to variables inside script itself problem xxx_anuj_xxx Programming 3 09-22-2007 11:24 PM
Conky on Suse 10.0 - *** buffer overflow detected *** conky terminated Slidex Linux - Software 1 03-17-2006 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration