1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-10-26 03:27:38 +00:00

Made scripts mor portable (run on SunOS 5.6 now).

This commit is contained in:
Alexander Barton
2003-04-22 19:27:50 +00:00
parent c74ac55832
commit 0551f688f6
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $
# $Id: getpid.sh,v 1.3 2003/04/22 19:27:50 alex Exp $
# wurde ein Name uebergeben?
[ $# -ne 1 ] && exit 1
@@ -18,7 +18,9 @@ fi
# PID ermitteln
ps $PS_FLAGS > procs.tmp
pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS )
cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n > pids.tmp
pid=`head $HEAD_FLAGS pids.tmp`
rm -rf procs.tmp pids.tmp
# ermittelte PID validieren
[ "$pid" -gt 1 ] > /dev/null 2>&1