Sunday, April 18, 2010

Postfix - Script to start

#!/bin/sh 
# 
# postfix This shell script takes care of starting and stopping 
# postfix. 
# 
# chkconfig: 2345 80 30 
# 
# description: Postfix is a Mail Transport Agent, which is the program 
# that moves mail from one machine to another. 
# Source function library. 
. /etc/rc.d/init.d/functions 
 
# Source networking configuration. 
. /etc/sysconfig/network 
 
# Check that networking is up. 
[ ${NETWORKING} = "no" ] && exit 0 
 
[ -f /usr/sbin/postfix ] || exit 0 
 
# See how we were called. 
case "$1" in 
   start) 
      # Start daemons. 
      echo -n "Starting postfix: " 
      newaliases 
      for I in access canonical relocated transport virtual 
      do 
      if [ -f /etc/postfix/$I ] ; then 
         /usr/sbin/postmap hash:/etc/postfix/$I < /etc/postfix/$I 
      fi 
      done 
      /usr/sbin/postfix start 2>/dev/null 
      echo postfix 
      touch /var/lock/subsys/postfix 
      ;; 
   stop) 
      # Stop daemons. 
      echo -n "Shutting down postfix: " 
      /usr/sbin/postfix stop 2>/dev/null 
      echo postfix 
      rm -f /var/lock/subsys/postfix 
      ;; 
   restart) 
      $0 stop 
      $0 start 
      ;; 
   reload) 
      /usr/sbin/postfix reload 
      ;; 
   status) 
      status master 
      ;; 
   *) 
      echo "Usage: $0 {start|stop|restart|reload|status}" 
      exit 1 
   esac 
 
exit 0
Cái này để bật tắt - chkconfig e postfix mà mình cài từ source :D
vim /etc/init.d/postfix
Press I to insert: paste to it
:wq
chmod 755 /etc/init.d/postfix
service postfix start
chkconfig --level 35 postfix on
Hii, h thì tiện hơn rồi. Mai rảnh viết tút postfixadmin :)
---------------------------------------------------------------------------
Thanks for reading
--------------------------------------------------------------------------
All my Lab:
Linux Lab -- window and Cisco Lab
to be continued - I will update more.

No comments:

Install Xposed Inspector and Frida on Genymotion

Today i had some work with android. So i need trace application. I found 2 nice tool can help me: Xposed Inspector and Frida. To setup ther...