summaryrefslogtreecommitdiff
blob: dde6850e2114d8a228b091c9672e9bc926f1bd17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * test-runlevels.c
 *
 * Test for runlevels functionality.
 *
 * Copyright (C) 2004,2005 Martin Schlemmer <azarah@nosferatu.za.org>
 *
 *
 *      This program is free software; you can redistribute it and/or modify it
 *      under the terms of the GNU General Public License as published by the
 *      Free Software Foundation version 2 of the License.
 *
 *      This program is distributed in the hope that it will be useful, but
 *      WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *      General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License along
 *      with this program; if not, write to the Free Software Foundation, Inc.,
 *      675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Header$
 */

#include <stdlib.h>

#include "librcscripts/rcscripts.h"

int
main (void)
{
  runlevel_info_t *runlevel_info;
  rcscript_info_t *script_info;
  
  if (-1 == get_rcscripts ())
    {
      EERROR ("Failed to get rc-scripts list!\n");
      exit (EXIT_FAILURE);
    }

  if (-1 == get_runlevels ())
    {
      EERROR ("Failed to get runlevel list!\n");
      exit (EXIT_FAILURE);
    }

#if 0
  EINFO ("Scripts:\n");

  list_for_each_entry (script_info, &rcscript_list, node)
    {
      printf ("  - %s\n", gbasename (script_info->filename));
    }

  printf ("\n");
#endif

  list_for_each_entry (runlevel_info, &runlevel_list, node)
    {
      EINFO ("Runlevel %s:\n", gbasename (runlevel_info->dirname));

      list_for_each_entry (script_info, &runlevel_info->entries, node)
	{
	  printf ("  - %s\n", gbasename (script_info->filename));
	}
    }

  return 0;
}