@@ -45,10 +45,14 @@ if [ ! "${OSTYPE}" ]; then
45
45
fi
46
46
47
47
# OSTYPE *is* defined on Solaris 10! (bug #3149)
48
+ # OSTYPE has many variants on darwin platforms
48
49
case " $OSTYPE " in
49
50
* solaris* )
50
51
OSTYPE=SunOS
51
52
;;
53
+ * [Dd]arwin* )
54
+ OSTYPE=darwin
55
+ ;;
52
56
Linux)
53
57
if [ -f /etc/SuSE-release ] ; then
54
58
OSDIST=' Suse'
66
70
;;
67
71
esac
68
72
69
- # #'echo -n' not supported with SH on Solaris
70
- if [ ${OSTYPE} = " SunOS" ]; then
73
+ # #'echo -n' not supported with SH on Solaris or darwin
74
+ if [ " ${OSTYPE} " = " SunOS" -o " ${OSTYPE} " = " darwin " ]; then
71
75
echo_opt=" "
72
76
else
73
77
echo_opt=" -n"
@@ -97,6 +101,8 @@ sympa_status() {
97
101
for pid in $pids ; do
98
102
if [ " $OSTYPE " = " BSD" ]; then
99
103
running=` ps -axw | grep " ^[[:space:]]*$pid [[:space:]]" `
104
+ elif [ " $OSTYPE " = " darwin" ]; then
105
+ running=` ps -A | grep " $pid .*$comm " `
100
106
else
101
107
running=` ps -A | grep " $pid ..* $comm " `
102
108
fi
@@ -219,6 +225,8 @@ sympa_stop() {
219
225
kill -TERM $pid > /dev/null 2>&1
220
226
if [ " $OSTYPE " = " BSD" ]; then
221
227
running=` ps -axw | grep " ^[[:space:]]*$pid [[:space:]]" `
228
+ elif [ " $OSTYPE " = " darwin" ]; then
229
+ running=` ps -A | grep " $pid .*$comm " `
222
230
else
223
231
running=` ps -A | grep " $pid ..* $comm " `
224
232
fi
@@ -229,6 +237,8 @@ sympa_stop() {
229
237
sleep 2
230
238
if [ " $OSTYPE " = " BSD" ]; then
231
239
running=` ps -axw | grep " ^[[:space:]]*$pid [[:space:]]" `
240
+ elif [ " $OSTYPE " = " darwin" ]; then
241
+ running=` ps -A | grep " $pid .*$comm " `
232
242
else
233
243
running=` ps -A | grep " $pid ..* $comm " `
234
244
fi
@@ -258,7 +268,7 @@ sympa_stop() {
258
268
259
269
260
270
# Check that networking is up.
261
- if [ ${OSTYPE} != " Linux" -a ${OSTYPE} != " BSD" -a ${OSTYPE} != " SunOS" -a ${OSTYPE} != " Darwin " ]; then
271
+ if [ ${OSTYPE} != " Linux" -a ${OSTYPE} != " BSD" -a ${OSTYPE} != " SunOS" -a ${OSTYPE} != " darwin " ]; then
262
272
if [ " ${NETWORKING} " = " no" ]
263
273
then
264
274
exit 0
0 commit comments