File: init.d

package info (click to toggle)
postfix 2.3.8-2%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 15,744 kB
  • ctags: 11,426
  • sloc: ansic: 81,810; makefile: 10,743; sh: 7,874; perl: 2,468; awk: 41
file content (88 lines) | stat: -rw-r--r-- 1,572 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/sbin/sh
#
# NOTE:    This script is not configurable!  Any changes made to this
#          scipt will be overwritten when you upgrade to the next
#          release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
#          is unbootable.  Do not modify this script.
#

#
# Start postfix
#

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

rval=0
set_return() {
	x=$?
	if [ $x -ne 0 ]; then
		echo "EXIT CODE: $x"
		rval=1
	fi
}


case $1 in
start_msg)
	echo "Start postfix"
	;;

stop_msg)
	echo "Stopping postfix"
	;;

'start')
	if [ -f /etc/rc.config.d/postfix ] ; then
	    . /etc/rc.config.d/postfix
	else
	    echo "ERROR:   /etc/rc.config/postfix defaults file MISSING"
	    rval=1
	    exit $rval
	fi
 
	if (( $START_POSTFIX )) && [[ -x /opt/postfix/bin/postfix ]]; then
	    if [[ ! -f /etc/postfix/main.cf ]]; then
		echo "ERROR:   Configuration file missing";
		rval=1
		exit $rval
	    fi

	    if [[ -n $POSTFIX_REQD_DIR && ! -d $POSTFIX_REQD_DIR ]]; then
		echo "WARNING: $POSTFIX_REQD_DIR not found - not starting postfix"
		rval=2
		exit $rval
	    fi

	    if /opt/postfix/bin/postfix start; then
		echo "postfix daemon started"
	    else
		set_return
		echo "Could not start postfix daemon"
    	    fi
	else
	    rval=2
	fi
	;;

'stop')
	if [[ -x /opt/postfix/bin/postfix ]]; then
	    if /opt/postfix/bin/postfix stop; then
		echo "postfix daemon killed"
	    else
		set_return
		echo "Could not stop postfix"
    	    fi
	else
	    rval=2
	fi
	;;

*)
	echo "usage: $0 {start|stop|start_msg|stop_msg}"
	;;
esac

exit $rval