Created
June 27, 2016 17:23
-
-
Save likai24/266ceaaa2400d015ea12abe2a17732cf to your computer and use it in GitHub Desktop.
检查系统的启动命令
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from http://unix.stackexchange.com/questions/18209/detect-init-system-using-the-shell | |
if [[ `/sbin/init --version` =~ upstart ]]; then echo using upstart; | |
elif [[ `systemctl` =~ -\.mount ]]; then echo using systemd; | |
elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then echo using sysv-init; | |
else echo cannot tell; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment