LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-27-2004, 05:59 AM   #1
fraxx
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)

script:
Quote:
#! /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):
Quote:
Derzeitige Server IP:

217.225.115.133

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

inet addr:217.225.115.133 P-t-P:217.5.98.61 Mask:255.255.255.255

PuTTY Client
any ideas?

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

Rep: Reputation: 36
Hello,

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


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 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 06:07 PM
PC to act as a server, possible? EvilAngel Linux - Networking 9 02-01-2005 04:45 PM
using ACT! with Linux Randy C Linux - Newbie 2 09-30-2004 11:44 AM
ACT! migration scott_R General 0 01-14-2004 04:40 AM
How come folders/viles created via PHP script act different from those dragged in? rvn Linux - Newbie 0 12-09-2003 06:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration