nix-processmgmt/tools/sysvinit/sysvinitchecks

22 lines
456 B
Bash

#!/bin/bash -e
checkRunlevel()
{
if [ "$runlevel" = "" ]
then
if command -v runlevel > /dev/null
then
runlevel=$(runlevel | cut -d ' ' -f2)
# If the runlevel is unknown, fall back to 3
if [ "$runlevel" = "unknown" ]
then
runlevel=3
fi
else
# If no runlevel command exists, then default to 3
runlevel=3
fi
fi
}