Skip to content

Commit 8967810

Browse files
authored
Merge pull request #1642 from ikedas/service_darwin
MacPorts: Fixes for service/sympa.in
2 parents 779db92 + 6042eed commit 8967810

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

service/sympa.in

+13-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ if [ ! "${OSTYPE}" ]; then
4545
fi
4646

4747
# OSTYPE *is* defined on Solaris 10! (bug #3149)
48+
# OSTYPE has many variants on darwin platforms
4849
case "$OSTYPE" in
4950
*solaris*)
5051
OSTYPE=SunOS
5152
;;
53+
*[Dd]arwin*)
54+
OSTYPE=darwin
55+
;;
5256
Linux)
5357
if [ -f /etc/SuSE-release ] ; then
5458
OSDIST='Suse'
@@ -66,8 +70,8 @@ Linux)
6670
;;
6771
esac
6872

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
7175
echo_opt=""
7276
else
7377
echo_opt="-n"
@@ -97,6 +101,8 @@ sympa_status() {
97101
for pid in $pids; do
98102
if [ "$OSTYPE" = "BSD" ]; then
99103
running=`ps -axw | grep "^[[:space:]]*$pid[[:space:]]"`
104+
elif [ "$OSTYPE" = "darwin" ]; then
105+
running=`ps -A | grep "$pid.*$comm"`
100106
else
101107
running=`ps -A | grep "$pid ..* $comm"`
102108
fi
@@ -219,6 +225,8 @@ sympa_stop() {
219225
kill -TERM $pid >/dev/null 2>&1
220226
if [ "$OSTYPE" = "BSD" ]; then
221227
running=`ps -axw | grep "^[[:space:]]*$pid[[:space:]]"`
228+
elif [ "$OSTYPE" = "darwin" ]; then
229+
running=`ps -A | grep "$pid.*$comm"`
222230
else
223231
running=`ps -A | grep "$pid ..* $comm"`
224232
fi
@@ -229,6 +237,8 @@ sympa_stop() {
229237
sleep 2
230238
if [ "$OSTYPE" = "BSD" ]; then
231239
running=`ps -axw | grep "^[[:space:]]*$pid[[:space:]]"`
240+
elif [ "$OSTYPE" = "darwin" ]; then
241+
running=`ps -A | grep "$pid .*$comm"`
232242
else
233243
running=`ps -A | grep "$pid ..* $comm"`
234244
fi
@@ -258,7 +268,7 @@ sympa_stop() {
258268

259269

260270
# 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
262272
if [ "${NETWORKING}" = "no" ]
263273
then
264274
exit 0

0 commit comments

Comments
 (0)