Shawn Craver wrote:
> 
> My problem is that I'm a student and occasionally others use my machine.
> The problem arises when either my room mate or a friend on the floor uses
> my machine and needs to use windows instead of Linux for what ever reason.
> The problem arises when I'm not in my room and the machine needs to be
> rebooted to get into windows. I don't want to give every one my root
> password to everyone who uses it, so I'd like to some how have the current
> IP of my computer emailed to me whenever a ppp connection is made from my
> machine. That way I could telnet to my machine and reboot it for them from
> across campus if need be.
> 
> I'm sure that I could just write a script of some sort to do this, but I
> don't have enough scripting experience to manage to figure it out on my
> own. Thanks in advance for any help you can offer.
> 
> My system is running Red Hat 5.2.
> 
>         --Shawn Craver
>           University Of Connecticut
>           Computer Science and Engineering
>           Undergraduate Student
Hi Shawn,

Perhaps this little scriptlet might help with the first part of your
problem, finding the IP-address:
--begin script--
#!/bin/sh
echo "Your IP-address is:"
/sbin/ifconfig ppp0 | grep inet | awk '{print $2}' | cut -f2 -d:
--end script--
As for getting it per e-mail, I think (correct me, someone who knows
better!) you need to configure sendmail and pipe the output of above
script to a mailto command.
-- 
   __o   See you, Christoph Hammann
 _ \>,   [EMAIL PROTECTED]
( )/( )____________________________
Last yeer I kudn't spel Engineer.  Now I are won.

Reply via email to