forked from ungleich-public/cdist
Updated the exlorer for more systems
changed the ps syntax, so it should work on freebsd to added a case so it could easy implemented for other os to
This commit is contained in:
parent
14f3ee403a
commit
2c49e04c98
1 changed files with 14 additions and 2 deletions
|
@ -18,7 +18,19 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Check whether the given name will be started on boot or not
|
# Returns the process name of pid 1 ( normaly the init system )
|
||||||
|
# for example at linux this value is "init" or "systemd" in most cases
|
||||||
#
|
#
|
||||||
|
|
||||||
ps -o comm= --pid 1
|
uname_s="$(uname -s)"
|
||||||
|
|
||||||
|
case "$uname_s" in
|
||||||
|
Linux|FreeBSD)
|
||||||
|
ps -o comm= -p 1 || true
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "init exlorer needs to be implemented for $os" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in a new issue