PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Taylo » Mon, 21 Jul 1997 04:00:00



(1)  Is there a script that will get my dial up ip and post it to a file on
an ftp site?

(2)  What file contains the aliases, i want to add an alias for rm="rm -i"
and have it stick each time i reboot, which is too often, (fiance' uses nt
to work on the same box.)

Thankyou, please post here or send me email.....Taylor

 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Paul A. Kammuelle » Mon, 21 Jul 1997 04:00:00



> (1)  Is there a script that will get my dial up ip and post it to a
> file on
> an ftp site?

> (2)  What file contains the aliases, i want to add an alias for rm="rm
> -i"
> and have it stick each time i reboot, which is too often, (fiance'
> uses nt
> to work on the same box.)

> Thankyou, please post here or send me email.....Taylor

   Taylor

Don't have the answer to the ftp question, (not sure I understand the
question -- you want a script that will post your ip to an ftp site?)
but aliases are stored in /etc/profile, or in .profile in your home
directory.   Somewhere in the file, just add the line:  rm="rm -i" and
it should work for every boot.

Paul


 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by @das » Mon, 21 Jul 1997 04:00:00



> (1)  Is there a script that will get my dial up ip and post it to a file on
> an ftp site?

I assume you're wanting to do this so people can access your machine?
If so... there's something you might want to look into...
http://www.dynip.com/  This gives you a static domain name, with a
dynamic IP.  I am running it currently, and it is very nice.  In fact,
the software will also let you register a domain with Internic, and they
will forward that to your IP as well (which is what I am doing)...

As far as an actual script is concerned, I've never seen one.  I'm not
the greatest scripter, but I think you might have problems uploading the
file via a script.  I think logging into an ftp server via command line
user/pass is possible, but from there, the FTP client would take over
until the ftp session was ended.

--
------------------------------------------------------------

------------------------------------------------------------

It is there to confuse spam bots... pesky things they are!)

 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Kevin Vaj » Tue, 22 Jul 1997 04:00:00


Nop guarantee that my answers are *correct*, but here goes...

Quote:> (1)  Is there a script that will get my dial up ip and post it to a file on
> an ftp site?

It's *very* error-prone, but you could do something like:

#echo $IPADDRESS > $LOCALFILE
(
sleep 2
echo user $USERNAME $PASSWORD
sleep 2
echo dele $REMOTEFILE
sleep 2
echo put $LOCALFILE $REMOTEFILE
sleep 2
echo chmod 644 $REMOTEFILE
sleep 2
echo bye
) | ftp -n $REMOTEHOST

Do you see what I'm saying?  A better approach would use expect.

As far as getting the IP address, just use ppp's ip-up script; it is
passed to /etc/ppp/ip-up as $4.

Quote:> (2)  What file contains the aliases, i want to add an alias for rm="rm -i"
> and have it stick each time i reboot, which is too often, (fiance' uses nt
> to work on the same box.)

Are you using bash?  If so, try putting something like this into
/etc/bashrc
or ~/.bashrc:

  case $- in
      *i*) #  Interactive shell:
           stty intr '^C' susp '^Z' kill '^U'
           alias which="type -path"
           alias lsf='ls -F'
           alias rm='rm -i'
  esac

Note that I only apply these commands to interactive shells.
Non-interactive
shells are, for example, when a shell is interpreting a script.  The
system
depends on many scripts executing a certain way, so you need to be very
careful
what non-interactive shells see in their configuration files.

Good luck!

--

- Kevin Vajk

 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Nelson Tibbi » Wed, 23 Jul 1997 04:00:00




Quote:> (1)  Is there a script that will get my dial up ip and post it to a file on
> an ftp site?

You can use my (admittedly weird) bash script.  It works fine for me.
I run it every time I connect.  Only thing is, you need a .netrc
file in your home dir with ftp login information so the script can
automatically upload the html file to your web server.  "man ftp"
for details on the .netrc format.

--- begin post_ip script ---

#!/bin/sh
#

# Variables for the customizing...
#
# Physical destination directory on the remote server
REMOTE_PLANDIR="/usr/apache/htdocs/"
# Desired destination filename to be placed in REMOTE_PLANDIR
REMOTE_PLANNAME="myip.html"
# Destination server  
REMOTE_SERVER="yourdomain.com"
#
# If REMOTE_PLANDIR is the physical root dir of your acct on the
# web server, a user would find your ip address at
# http://REMOTE_SERVER/REMOTE_PLANNAME ..
#
# If REMOTE_PLANDIR is /usr/apache/htdocs/yourname/blahblah/blah
# where /usr/apache/htdocs/yourname is your acct's root physical
# dir on the web server, a user would find your ip address at
# http://REMOTE_SERVER/blahblah/blah/REMOTE_PLANNAME ..

# Local (writable) temporary directory
  TMPDIR="/usr/tmp"
# Title of the html file to be generated
  HTMLHEAD="PAGETITLE"

# Temporary files, no need to change unless you really want to
  TFILE="sonny.htm"
  TSCPT="ip.script"

# Determine local IP address for PPP device
GETMYIP=$(/sbin/ifconfig | awk 'BEGIN { pppok = 0} \
  /ppp.*/ { pppok = 1; next } \
  {if (pppok == 1 ) {pppok = 0; print} }'\
  | awk -F: '{print $2 }'| awk  '{print $1 }')

# Old (dumb) GetMyIp method
#GETMYIP=$(/sbin/ifconfig | /usr/bin/grep -A 4 ppp0 \
#  | /bin/awk '/inet/ { print $2 } ' | /bin/sed -e s/addr://)

# Used to place date/time of last connection in the page
FORMATTED_DATE=$(date '+%B %-d, %I:%M %p')

# Now, do it!  First give PPP_DEV time to init..
sleep 10
echo "Current IP: $GETMYIP"

# Generate the html file...
rm -f $TMPDIR/$TFILE
echo "Writing $REMOTE_PLANNAME"
echo >> $TMPDIR/$TFILE
echo "<html><head><title>$HTMLHEAD</title></head>"            >> $TMPDIR/$TFILE
echo "<body bgcolor=#ffffff><center>"                         >> $TMPDIR/$TFILE
echo "<p>The last "                                           >> $TMPDIR/$TFILE
echo "time I connected was <b>$FORMATTED_DATE</b>, when "     >> $TMPDIR/$TFILE
echo "my box was assigned <b>$GETMYIP</b>. <p><a href="       >> $TMPDIR/$TFILE
echo "http://$GETMYIP target=_top>http://$GETMYIP</a><p>"     >> $TMPDIR/$TFILE
echo "<a href=ftp://$GETMYIP target=_top>ftp://$GETMYIP</a>"  >> $TMPDIR/$TFILE
echo "<p><a href=telnet://$GETMYIP>telnet://$GETMYIP</a><br>" >> $TMPDIR/$TFILE
echo "(Telnet must be properly configured in your browser.)"  >> $TMPDIR/$TFILE
echo "<p>The above links will only work while I'm connected." >> $TMPDIR/$TFILE

# Generate the ftp script and upload
 echo "put $TMPDIR/$TFILE" $REMOTE_PLANDIR/$REMOTE_PLANNAME > $TMPDIR/$TSCPT
 echo "quit" >> $TMPDIR/$TSCPT
 echo "Uploading $REMOTE_PLANNAME to $REMOTE_SERVER..."
 ftp $REMOTE_SERVER < $TMPDIR/$TSCPT &> /dev/null

echo -n "Cleaning up... "
rm -f $TMPDIR/$TFILE ; rm -f $TMPDIR/$TSCPT
# these are probably unnecessary, but make for clean look 'n feel ;)
unset REMOTE_SERVER REMOTE_PLANDIR REMOTE_PLANNAME
unset GETMYIP FORMATTED_DATE PPP_DEV TMPDIR TFILE TSCPT
echo "Done."

#

---- end post_ip script ---

Quote:> (2)  What file contains the aliases, i want to add an alias for rm="rm -i"
> and have it stick each time i reboot, which is too often, (fiance' uses nt
> to work on the same box.)

I assume you're using bash....

/etc/bashrc for system wide stuff..

~/.bashrc for user specific stuff...

Quote:

> Thankyou, please post here or send me email.....Taylor

--
Nelson Tibbitt

http://this.is/nelson
 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Antony Ki » Mon, 28 Jul 1997 04:00:00



Quote:>(1)  Is there a script that will get my dial up ip and post it to a file on
>an ftp site?

Um, not quite sure what you want to do here.

Quote:>(2)  What file contains the aliases, i want to add an alias for rm="rm -i"
>and have it stick each time i reboot, which is too often, (fiance' uses nt
>to work on the same box.)

if you're using csh, then stick the alias command at the end of the
cshrc file in your home dir  - that gets executed each time you start
a new shell,
ie :

# ~/.cshrc
# do stuff when starting a shell
alias rm rm -i
alias dir ls -CF

--

       _o   Cyclist, Linux Fanatic and Coffee Freak
......O>O.............................................

 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Roy Wils » Mon, 28 Jul 1997 04:00:00




>>(1)  Is there a script that will get my dial up ip and post it to a file on
>>an ftp site?

> Um, not quite sure what you want to do here.

>>(2)  What file contains the aliases, i want to add an alias for rm="rm -i"
>>and have it stick each time i reboot, which is too often, (fiance' uses nt
>>to work on the same box.)

> if you're using csh, then stick the alias command at the end of the
> cshrc file in your home dir  - that gets executed each time you start
> a new shell,
> ie :

> # ~/.cshrc
> # do stuff when starting a shell
> alias rm rm -i
> alias dir ls -CF

> --

>        _o   Cyclist, Linux Fanatic and Coffee Freak
> ......O>O.............................................

*************************************************************************

        You also wil want to add these:

                alias mv mv -i
                alias cp cp -i

        -roy-

 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Balgera Dieg » Tue, 05 Aug 1997 04:00:00



> (1)  Is there a script that will get my dial up ip and post it to a
> file on
> an ftp site?

if you want to get the ip address of a dial-up connection (with dynamic
IP address, of course), assuming that the dial-up device is ppp0, try
this:

#! /bin/sh
#
PPP0IP=`ifconfig ppp0 | sed -n -e "s/^[ ]*inet
addr\:\([0-9\.]*\).*$/\1/p"`
echo "$PPP0IP" >ppp0ip.file

the ppp0ipfile so will contain the dynamic IP address, and you can
trasfer it on the ftp server.
Hope this can help you ...

Bye.

Balgera Diego

 
 
 

PLEASE ANSWER ONE OF THESE FOR ME......CANT FIND ANYWHERE!

Post by Anthony Patrick For » Mon, 11 Aug 1997 04:00:00




>> (1)  Is there a script that will get my dial up ip and post it to a
>> file on
>> an ftp site?

Make a script  in /etc/ppp called ip-up.  When you connect it is
automaticly run and passed(among other things) your dynamic ip.
Access it as $4 in the script.

What do you want to do with it on the remote site?  If you have cgi access
I can show you a one line script to get it up without using ftp.

Anthony

http://www.cs.purdue.edu/homes/formaap/

 
 
 

1. Cant find lib anywhere ..HELP !!!!

I recently installed linux using SLS .99pl10
but many of my binaries complain that they
cannot load /lib/libm.so.4. I checked out
and find that /lib/libm.so.4 is a symbolic
link to /lib/libm.so.4.3.3 which i couldnt find
anywhere on the ftp servers (of course also not
on the floppies from which i installed).
Can anyone give me some hint about this problem ?
Thanks in advance.....
                                /P

2. Dual Enet connections between two machines

3. ISO The Following Packages - Cant find anywhere

4. Need Module for NetFlex Network Card

5. HELP Please: PPP going but I cant get anywhere

6. How do you know your system is OK with Linux

7. redhat 5.1 install cant find first HD

8. Cant compile applications: "make" cant find "cc"

9. pppd problems------------>One answer and maybe some help---- - pppd answers.ZIP (1/1)

10. pppd problems------------>One answer and maybe some help---- - pppd answers.ZIP (0/1)

11. Can login to ISP but cant cannot get to anywhere

12. Cant connect to one IP in network, but can every other one