Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/sbin/sh
- #
- # Set the path to your own logger & postfix commands
- # Sample SysV-style
- #
- LOGGER="/usr/bin/logger"
- POSTFIX="/usr/sbin/postfix"
- rc=0
- if [ ! -f $POSTFIX ] ; then
- $LOGGER -t $0 -s -p mail.err "Unable to locate Postfix"
- exit(1)
- fi
- if [ ! -f /etc.postfix/main.cf ] ; then
- $LOGGER -t $0 -s -p mail.err "Unable to locate Postfix configuration"
- exit(1)
- fi
- case "$1" in
- start)
- echo -n "Starting Postfix"
- $POSTFIX start
- rc=$?
- echo "."
- ;;
- stop)
- echo -n "Stopping Postfix"
- $POSTFIX stop
- rc=$?
- echo "."
- ;;
- restart)
- echo -n "Restarting Postfix"
- $POSTFIX stop
- rc=$?
- echo "."
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- rc=1
- esac
- exit $rc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement