2 * runlevel Prints out the previous and the current runlevel.
4 * Version: @(#)runlevel 1.20 16-Apr-1997 MvS
6 * This file is part of the sysvinit suite,
7 * Copyright 1991-1997 Miquel van Smoorenburg.
9 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
11 * initially busyboxified by Bernhard Fischer
21 int runlevel_main(int argc, char *argv[])
26 if (argc > 1) utmpname(argv[1]);
29 while ((ut = getutent()) != NULL) {
30 if (ut->ut_type == RUN_LVL) {
31 prev = ut->ut_pid / 256;
32 if (prev == 0) prev = 'N';
33 printf("%c %c\n", prev, ut->ut_pid % 256);