++ // but only if we're not shutting down / rebooting
++ setutent();
++ while ((ut = getutent()) != NULL) {
++ if (ut->ut_type == RUN_LVL) {
++ runlevel = ut->ut_pid % 256;
++ break;
++ }
++ }
++ endutent();
++ if (1 <= runlevel && runlevel <= 5)
++ system("/usr/bin/chvt 1");