#! /bin/bash
#simply detect running init

if [ -n "$1" ]; then
  exit 0
elif [ -e /run/runit]; then
  echo "runit"
  exit 2
elif [ -e /run/66 ]; then
  echo "s6-66"
  exit 3
elif [ -e /run/s6-rc ]; then
  echo "s6-rc"
  exit 4
elif [ -e /run/dinitctl ]; then
  echo "dinit"
  exit 5
elif [ -e /run/initctl ]; then
  echo "sysVinit"
  exit 6
elif [ -e /run/openrc ]; then
  echo "openrc"
  exit 7
fi
echo "unknown"
exit 1

