Allow service_* functions to work off SVCNAME if no arguments passed
This commit is contained in:
parent
e4b73c506b
commit
05a9d0e25e
8
src/rc.c
8
src/rc.c
@ -300,8 +300,14 @@ static int do_e (int argc, char **argv)
|
|||||||
static int do_service (int argc, char **argv)
|
static int do_service (int argc, char **argv)
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
char *service = NULL;
|
||||||
|
|
||||||
if (argc < 1 || ! argv[0] || strlen (argv[0]) == 0)
|
if (argc > 0)
|
||||||
|
service = argv[0];
|
||||||
|
else
|
||||||
|
service = getenv ("SVCNAME");
|
||||||
|
|
||||||
|
if (! service || strlen (service) == 0)
|
||||||
eerrorx ("%s: no service specified", applet);
|
eerrorx ("%s: no service specified", applet);
|
||||||
|
|
||||||
if (strcmp (applet, "service_started") == 0)
|
if (strcmp (applet, "service_started") == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user