LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-20-2005, 11:31 PM   #1
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Posts: 1,210
Blog Entries: 4

Rep: Reputation: 45
auto send email at bootup


Hi!

I would like to a machine to send email of it's ifconfig everytime it boot up. How can I do this? Thanks.
 
Old 01-20-2005, 11:36 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Which distro? The general procedure would be to add a call to the mail command in your rc.local file or its equivalent.
 
Old 01-20-2005, 11:44 PM   #3
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Posts: 1,210

Original Poster
Blog Entries: 4

Rep: Reputation: 45
Slackware current.

Well, the prob is I don't know how to send email via command line.
mail command? Alright, will start digging from there.

If someone have the complete solution. Please share.
 
Old 01-21-2005, 12:05 AM   #4
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Posts: 1,210

Original Poster
Blog Entries: 4

Rep: Reputation: 45
Which package does mail come from?

fetchmail
getmail
metamail
procmail
sendmail
????
 
Old 01-21-2005, 01:13 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You may want to use a "here document" in your script.

example:

$DATENOW=`date`
/usr/sbin/sendmail -t <<endofmessage
From: root@someplace.com
To: nobody@noplace.you.know.com
Subject: computer restarted

The computer has been restarted at $DATE
endofmessage
 
Old 01-21-2005, 02:12 AM   #6
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Posts: 1,210

Original Poster
Blog Entries: 4

Rep: Reputation: 45
thanks jschiwal.

does that mean I got to configure sendmail?
 
Old 01-21-2005, 04:54 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Postfix, and others have a program called sendmail so that scripts like yours will still work.
Or just find out what the equivalent program is that you already have installed and modify your script.

Last edited by jschiwal; 01-21-2005 at 04:55 PM.
 
Old 01-30-2005, 12:39 AM   #8
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Posts: 1,210

Original Poster
Blog Entries: 4

Rep: Reputation: 45
Can I use mutt to mail out instead? I do not wish to setup a email server on my machine.

If I can use mutt, how will the script look like? I am total newb for mutt. Reading tutorial and man page now.
 
  


Reply



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
email 'send' NO - email 'receive' YES..? captain skywave Linux - Wireless Networking 4 04-23-2005 03:35 AM
email 'send' YES - email 'receive' NO..? captain skywave Linux - Wireless Networking 1 04-22-2005 05:23 AM
Auto run at bootup irfan44 Linux - Software 6 05-21-2004 08:44 AM
Auto starting, mounting at bootup 2nd2none Linux - General 5 04-05-2004 09:58 AM
Allowing an IP to send email using my email server... culprit Linux - Networking 7 09-09-2003 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:34 PM.

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
Open Source Consulting | Domain Registration