1 /* vi: set sw=4 ts=4: */
3 * runlevel Prints out the previous and the current runlevel.
5 * Version: @(#)runlevel 1.20 16-Apr-1997 MvS
7 * This file is part of the sysvinit suite,
8 * Copyright 1991-1997 Miquel van Smoorenburg.
10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
12 * initially busyboxified by Bernhard Reutner-Fischer
17 int runlevel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
18 int runlevel_main(int argc UNUSED_PARAM, char **argv)
23 if (argv[1]) utmpname(argv[1]);
26 while ((ut = getutent()) != NULL) {
27 if (ut->ut_type == RUN_LVL) {
28 prev = ut->ut_pid / 256;
29 if (prev == 0) prev = 'N';
30 printf("%c %c\n", prev, ut->ut_pid % 256);
31 if (ENABLE_FEATURE_CLEAN_UP)
39 if (ENABLE_FEATURE_CLEAN_UP)