LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2005, 09:08 PM   #1
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Rep: Reputation: 30
write a shell script to send email


hi,

i have a dailed-up machine (FC2) serving as Internet gw and Web proxying, remotely operated at another town. through, firewall setting, i have configured in such a way that, the machine only accept ssh from my own static ip gateway. but, the trouble is that, everytime the machine reboots. network service is restarting, firewall rule is loading, then, i have to call them and ask the office boy to get me the new dailed ip. pretty stupid, huh?. can i have a script, once the ip (internet gw ip, i mean) is changed, then, it will straight email to my account?? could it be possible??? give me a pointer to look into it. thanks...

Cheers,
yenonn
 
Old 02-06-2005, 10:15 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try http://www.no-ip.com/ or http://www.dyndns.org/ . I believe they have the right service for you
 
Old 02-07-2005, 05:37 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
sending email is easy from the command line/shell script

try:

Code:
cat  FILE | mailx -s Subject    me@blah.sol.mars
 
Old 02-11-2005, 09:40 PM   #4
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
do i need to set the default smtp server?? thanks
 
Old 02-11-2005, 10:06 PM   #5
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
ifconfig ppp0 | mail -s "IP information" user@host.com

The need for an SMTP server is dependant on *many* things. To be correct, you'd be best off setting the local MTA to forward all email (for which it's not the final destination) through your ISP's SMTP gateway unless you have control over your reverse DNS, yadda yadda yadda ...

Last edited by sigsegv; 02-11-2005 at 10:08 PM.
 
  


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
Script to send email... bfloeagle Linux - General 5 10-13-2009 10:20 AM
Write a script to send an email from bash kpelczar Linux - Software 5 02-09-2005 04:19 PM
Qmail: send email from shell mikeshn Linux - General 1 09-30-2004 01:19 AM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM
send email through shell mikeshn Linux - General 10 01-01-2004 02:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:24 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