Commit ca807a1e authored by Lucas Russo's avatar Lucas Russo

scripts/get-init-system.sh: add script to detect init system

parent e8850460
#!/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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment