openrc-run: respect the IN_DRYRUN environment variable

This allows rc-service to pass the tryrun option to openrc-run.

This is for #225.
This commit is contained in:
William Hubbs 2018-05-14 19:08:19 -05:00
parent 414a9aae6c
commit d980798d64

View File

@ -1282,6 +1282,8 @@ int main(int argc, char **argv)
unsetenv("IN_BACKGROUND"); unsetenv("IN_BACKGROUND");
} }
if (rc_yesno(getenv("IN_DRYRUN")))
dry_run = true;
if (rc_yesno(getenv("IN_HOTPLUG"))) { if (rc_yesno(getenv("IN_HOTPLUG"))) {
if (!service_plugable()) if (!service_plugable())
eerrorx("%s: not allowed to be hotplugged", applet); eerrorx("%s: not allowed to be hotplugged", applet);