mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	- neues Script getpid.sh (aus HEAD): dieses ermittelt nun die PID des Servers.
This commit is contained in:
		
							
								
								
									
										28
									
								
								src/testsuite/getpid.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								src/testsuite/getpid.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| #!/bin/sh | ||||
| # ngIRCd Test Suite | ||||
| # $Id: getpid.sh,v 1.1.2.1 2002/09/20 15:19:55 alex Exp $ | ||||
|  | ||||
| # wurde ein Name uebergeben? | ||||
| [ $# -ne 1 ] && exit 1 | ||||
|  | ||||
| # Flags fuer "ps" ermitteln | ||||
| if [ `uname` = "FreeBSD" ]; then | ||||
|   PS_FLAGS=-a; PS_PIDCOL=1 | ||||
| else | ||||
|   PS_FLAGS=-f; PS_PIDCOL=2 | ||||
|   ps $PS_FLAGS > /dev/null 2>&1 | ||||
|   if [ $? -ne 0 ]; then PS_FLAGS=a; PS_PIDCOL=1; fi | ||||
| fi | ||||
|  | ||||
| # PID ermitteln | ||||
| ps $PS_FLAGS > procs.tmp | ||||
| pid=`cat procs.tmp | grep "$1" | awk "{ print \\\$$PS_PIDCOL }" | sort -n | head -n 1` | ||||
|  | ||||
| # ermittelte PID validieren | ||||
| [ "$pid" -gt 1 ] > /dev/null 2>&1 | ||||
| [ $? -ne 0 ] && exit 1 | ||||
|  | ||||
| echo $pid | ||||
| exit 0 | ||||
|  | ||||
| # -eof- | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton