Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bpm-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
bpm
bpm-sw
Commits
ca807a1e
Commit
ca807a1e
authored
Feb 05, 2016
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts/get-init-system.sh: add script to detect init system
parent
e8850460
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
get-init-system.sh
scripts/get-init-system.sh
+14
-0
No files found.
scripts/get-init-system.sh
0 → 100755
View file @
ca807a1e
#!/usr/bin/env bash
# Based from the stackexchange answer
# http://unix.stackexchange.com/questions/18209/detect-init-system-using-the-shell
if
[[
`
/sbin/init
--version
`
=
~ upstart
]]
;
then
echo
"upstart"
;
elif
[[
`
systemctl
`
=
~ -
\.
mount
]]
;
then
echo
"systemd"
;
elif
[[
-f
/etc/init.d/cron
&&
!
-h
/etc/init.d/cron
]]
;
then
echo
"sysv-init"
;
else
echo
"?"
;
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment