diff options
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/Makefile | 2 | ||||
-rw-r--r-- | src/rc/rc.c | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/rc/Makefile b/src/rc/Makefile index 1168b3f2..587d60d7 100644 --- a/src/rc/Makefile +++ b/src/rc/Makefile @@ -23,7 +23,7 @@ RC_BINLINKS= einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \ service_coldplugged service_started_daemon \ checkpath fstabinfo mountinfo rc-depend \ service_get_value service_set_value get_options save_options \ - shell_var + shell_var is_newer_than is_older_than RC_SBINLINKS= mark_service_starting mark_service_started \ mark_service_stopping mark_service_stopped \ mark_service_inactive mark_service_wasinactive \ diff --git a/src/rc/rc.c b/src/rc/rc.c index 567da725..93be82d4 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -913,6 +913,21 @@ int main (int argc, char **argv) if (strncmp (applet, "mark_service_", strlen ("mark_service_")) == 0) exit (do_mark_service (argc, argv)); + if (strcmp (applet, "is_newer_than") == 0 || + strcmp (applet, "is_older_than") == 0) + { + bool match = false; + if (argc < 2) + exit (EXIT_FAILURE); + if (strcmp (applet, "is_newer_than") == 0) + match = true; + while (optind < argc) { + if (rc_newer_than (argv[0], argv[optind++]) != match) + exit (EXIT_FAILURE); + } + exit (EXIT_SUCCESS); + }; + if (strcmp (applet, "is_runlevel_start") == 0) exit (rc_runlevel_starting () ? 0 : 1); else if (strcmp (applet, "is_runlevel_stop") == 0) |