According to Christoph Hammann: While burning my CPU.
>
> 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:"
That will only be echoed to the console.
> /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.
No there is no need to touch anything in sendmail, simply pipe the output to
"mail" like.
/sbin/ifconfig ppp0 | grep inet | awk '{print $2}' | cut -f2 -d: | mail
host@machine
Be careful when using 'cut' and awk together as sometimes fields can shift,
which "could" result in the wrong information being gained, or at worst no
info will be shown. Simply do ifconfig ppp0 | mail host@machine
On the otherhand i ask myself why all this is nessacary.? I presume by
reading the message that the users of that machine have physical access, all
they need to do under normal curcumstancies is just hit the ctrl-alt-delte
keys simultainiously which will reboot the machine, then at the lilo prompt
the user just types windows or whatever the keyword is for booting into that
particular system.
Having LILO boot Linux as default will result in Linux being booted upon
leaving windows.
Surely if everyone is on campus then there would be a local LAN, so if the
owner was on the otherside of campus, then all he would need to do is telnet
to his hostname, but i might be taking to much for granted by saying that.
> --
> __o See you, Christoph Hammann
> _ \>, [EMAIL PROTECTED]
> ( )/( )____________________________
> Last yeer I kudn't spel Engineer. Now I are won.
>
--
Regards Richard.
[EMAIL PROTECTED]