File: lsb_start_daemon

package info (click to toggle)
uruk 20140627-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,088 kB
  • ctags: 70
  • sloc: sh: 1,770; makefile: 143; xml: 51
file content (45 lines) | stat: -rwxr-xr-x 650 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

. /etc/init.d/functions

nice=
force=
pidfile=
user=
check=
RETVAL=
while [ "$1" != "${1##[-+]}" ]; do
	case $1 in
	     -f)
	     	force="--force"
		shift
		;;
	     -n)
	     	nice=$2
		shift 2
		;;
	     -p)
		pidfile="--pidfile $2"
		shift 2
		;;
	     -u)
	        user="--user $2"
		shift 2
		;;
	     -c)
	        check="--check $2"
		shift 2
		;;
	      *)     
 		echo "Unknown Option $1"
 		echo "Options are:"
 		echo "-f" 
		echo "-p {pidfile}"
		echo "-n [+/-nicelevel]"
		echo "-u {user}"
		echo "-c {base}"
	        exit 1;;	
	esac
done
LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $*
exit $?