- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to check greeting line in /etc/mail/sendm...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2009 01:28 AM
10-05-2009 01:28 AM
"O SmtpGreetingMessage= Mail Server Ready ; $b"
this script is only for checking
the script will give an output as
-if there is no greeting line present in /etc/mail/sendmail.cf it will echo "NOK"
-if there is greeting line is present then it will echo "OK".
regards
chicuks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2009 02:29 AM
10-05-2009 02:29 AM
Solution#!/bin/bash
grep "O SmtpGreetingMessage= Mail Server Ready ; \$b" /etc/mail/sendmail.cf &> /dev/null
if [ $? -eq 0 ]; then
echo OK
else
echo NOK
fi
If I remember correctly grep returns 0 if it matches something, else it returns a higher return number (unsure if it's 1 or higher).
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2009 03:36 AM
10-05-2009 03:36 AM
Re: script to check greeting line in /etc/mail/sendmail.cf
> script to check greeting line in /etc/mail/sendmail.cf
MANY of your questions are really the SAME question re-framed --- "...script to check..."; "...this script is only for checking"; "...echo 'NOK'...echo 'OK'."
I suggest that you re-read the answers to the questions like this one that you have already asked. You should begin to see a pattern to the simple solutions offered.
I suggest too, that you get a book or two on Shell scripting. It is a fundamental requirement for any good system administrator. For a start, see:
http://docs.hp.com/en/B2355-90046/B2355-90046.pdf
Don't use the c-shell ('csh') nor worry about the Bourne shell. Concentrate on the Posix/Korn syntax which extends too to the GNU Bash shell if/as you use it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2009 03:44 AM
10-05-2009 03:44 AM
Re: script to check greeting line in /etc/mail/sendmail.cf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2009 04:16 AM
10-05-2009 04:16 AM