LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   linux scripting (https://www.linuxquestions.org/questions/linux-newbie-8/linux-scripting-255165/)

redhatbeatswin 11-15-2004 12:50 PM

linux scripting
 
hey everyone...

red hat 9 user here... have a question about scripting...

i want a script to run everytime i start up my PC that will grep the entire contents of an ifconfig and output it to a txt file, and email the text file to myself.

i beleive i have sendmail running properly... maybe someone here can point me in the right direction?

Mara 11-15-2004 01:02 PM

You may add it do starting scripts (/etc/rc.d/init.d and then symlinked to the right directories: /etc/rcX.d where X is your runlevel; that's 'cleaner', but harder method) or just add the commend to run it to /etc/rc.local (that's one of the scripts that are run at boot automaticaly).

david_ross 11-15-2004 01:02 PM

You could add something like this to the end of rc.local:
/sbin/ifconfig | grep something | mail user@host.com -s "IP details"


All times are GMT -5. The time now is 10:38 PM.