File: runlevel.sh

package info (click to toggle)
finit 4.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,216 kB
  • sloc: ansic: 17,060; sh: 6,281; makefile: 532
file content (18 lines) | stat: -rwxr-xr-x 325 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# Verify selecting alternate runlevel from cmdline
# shellcheck disable=SC2034
set -eu

TEST_DIR=$(dirname "$0")
FINIT_RUNLEVEL=9

# shellcheck source=/dev/null
. "$TEST_DIR/lib/setup.sh"

say 'Check runlevel'
lvl=$(run "initctl runlevel | awk '{print \$2;}'")
if [ "$lvl" -eq "9" ]; then
    return 0
fi

return 1