Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-27-2004, 04:59 AM   #1
LQ Newbie
Registered: May 2004
Posts: 1

Rep: Reputation: 0
script problem - act different

my problem:

i made an script to publish my current server ip (my provider uses dynamic ips) on a website. the script works the way it should starting it manually, but don't as a cronjob.

destribution: debian (knoppix 3.4)

#! /bin/bash
# ftp-script
rm -f /data/currentip.html
echo "<html><body><font face='Tahoma' color='green' style='font-size: 10pt'><u>Derzeitige Server IP:</u><br><br><font color='black' style='font-size: 8pt'><b>" >> /data/currentip.html
/sbin/ifconfig ppp0 > /data/ip
/bin/cat /data/ip | /bin/grep inet | /bin/sed 's/.*Adresse:\([0-9\.]*\) .*/\1/g' >> /data/currentip.html
echo "</b><br><br><a href='putty.exe'>PuTTY Client</a></body></html>" >> /data/currentip.html
cp /data/currentip.html /var/www/currentip.html
result (started manually):
Derzeitige Server IP:

PuTTY Client
result (started as a cronjob):
Derzeitige Server IP:

inet addr: P-t-P: Mask:

PuTTY Client
any ideas?

Old 05-27-2004, 10:41 AM   #2
Senior Member
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36

what you can try is:
echo $(/bin/cat /data/ip | /bin/grep inet | /bin/sed 's/.*Adresse:\([0-9\.]*\) .*/\1/g')


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert ACT to MP3 problem irvken Linux - Software 2 06-07-2010 05:07 PM
PC to act as a server, possible? EvilAngel Linux - Networking 9 02-01-2005 03:45 PM
using ACT! with Linux Randy C Linux - Newbie 2 09-30-2004 10:44 AM
ACT! migration scott_R General 0 01-14-2004 03:40 AM
How come folders/viles created via PHP script act different from those dragged in? rvn Linux - Newbie 0 12-09-2003 05:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:29 PM.

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