diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-06-22 09:45:41 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-06-22 09:45:41 +0000 |
| commit | b4cfcc4383a7ed6ae05e547c364ff82f035710a6 (patch) | |
| tree | ce4e9f34262767e5db53644b802ef0a6a1a09a35 /usr.sbin/sysinstall/dispatch.c | |
| parent | 172d6524dfdec80c212a1ca1ff27813ee3c59227 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/sysinstall/dispatch.c')
| -rw-r--r-- | usr.sbin/sysinstall/dispatch.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c index e72303a1daee..8251f9bd9951 100644 --- a/usr.sbin/sysinstall/dispatch.c +++ b/usr.sbin/sysinstall/dispatch.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dispatch.c,v 1.17 1997/06/13 17:55:32 jkh Exp $ + * $Id: dispatch.c,v 1.18 1997/06/21 15:45:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -38,6 +38,7 @@ #include <ctype.h> static int _shutdown(dialogMenuItem *unused); +static int _systemExecute(dialogMenuItem *unused); static struct _word { char *name; @@ -102,6 +103,7 @@ static struct _word { { "addGroup", userAddGroup }, { "addUser", userAddUser }, { "shutdown", _shutdown }, + { "system", _systemExecute }, { NULL, NULL }, }; @@ -122,12 +124,25 @@ call_possible_resword(char *name, dialogMenuItem *value, int *status) } /* Just convenience */ -static int _shutdown(dialogMenuItem *unused) +static int +_shutdown(dialogMenuItem *unused) { systemShutdown(0); return DITEM_FAILURE; } +static int +_systemExecute(dialogMenuItem *unused) +{ + char *cmd = variable_get("command"); + + if (cmd) + return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS; + else + msgDebug("_systemExecute: No command passed in `command' variable.\n"); + return DITEM_FAILURE; +} + /* For a given string, call it or spit out an undefined command diagnostic */ int dispatchCommand(char *str) |
