Revision 8e2ed2e8 daemons/daemon-util.in
b/daemons/daemon-util.in | ||
---|---|---|
1 | 1 |
#!/bin/bash |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2009 Google Inc. |
|
4 |
# Copyright (C) 2009, 2012 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
108 | 108 |
return 0 |
109 | 109 |
} |
110 | 110 |
|
111 |
# Prints path to PID file for a daemon. |
|
112 |
daemon_pidfile() { |
|
113 |
if [[ "$#" -lt 1 ]]; then |
|
114 |
echo 'Missing daemon name.' >&2 |
|
115 |
return 1 |
|
116 |
fi |
|
117 |
|
|
118 |
local name="$1"; shift |
|
119 |
|
|
120 |
_daemon_pidfile $name |
|
121 |
} |
|
122 |
|
|
123 |
# Prints path to daemon executable. |
|
124 |
daemon_executable() { |
|
125 |
if [[ "$#" -lt 1 ]]; then |
|
126 |
echo 'Missing daemon name.' >&2 |
|
127 |
return 1 |
|
128 |
fi |
|
129 |
|
|
130 |
local name="$1"; shift |
|
131 |
|
|
132 |
_daemon_executable $name |
|
133 |
} |
|
134 |
|
|
111 | 135 |
# Prints a list of all daemons in the order in which they should be started |
112 | 136 |
list_start_daemons() { |
113 | 137 |
local name |
Also available in: Unified diff