00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "includes.h"
00025 #include "rpcclient.h"
00026
00027 #if 0
00028
00029
00030
00031
00032
00033 static NTSTATUS cmd_shutdown_init(struct cli_state *cli, TALLOC_CTX *mem_ctx,
00034 int argc, const char **argv)
00035 {
00036 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
00037 fstring msg;
00038 uint32 timeout = 20;
00039 BOOL force = False;
00040 BOOL reboot = False;
00041 int opt;
00042
00043 *msg = 0;
00044 optind = 0;
00045
00046 while ((opt = getopt(argc, argv, "m:t:rf")) != EOF)
00047 {
00048
00049
00050 switch (opt)
00051 {
00052 case 'm':
00053 fstrcpy(msg, optarg);
00054
00055 break;
00056
00057 case 't':
00058 timeout = atoi(optarg);
00059
00060 break;
00061
00062 case 'r':
00063 reboot = True;
00064 break;
00065
00066 case 'f':
00067 force = True;
00068 break;
00069
00070 }
00071 }
00072
00073
00074 result = cli_shutdown_init(cli, mem_ctx, msg, timeout, reboot, force);
00075
00076 if (NT_STATUS_IS_OK(result))
00077 DEBUG(5,("cmd_shutdown_init: query succeeded\n"));
00078 else
00079 DEBUG(5,("cmd_shutdown_init: query failed\n"));
00080
00081 return result;
00082 }
00083
00084
00085
00086
00087 static NTSTATUS cmd_shutdown_abort(struct cli_state *cli,
00088 TALLOC_CTX *mem_ctx, int argc,
00089 const char **argv)
00090 {
00091 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
00092
00093 result = cli_shutdown_abort(cli, mem_ctx);
00094
00095 if (NT_STATUS_IS_OK(result))
00096 DEBUG(5,("cmd_shutdown_abort: query succeeded\n"));
00097 else
00098 DEBUG(5,("cmd_shutdown_abort: query failed\n"));
00099
00100 return result;
00101 }
00102 #endif
00103
00104
00105
00106 struct cmd_set shutdown_commands[] = {
00107
00108 { "SHUTDOWN" },
00109
00110 #if 0
00111 { "shutdowninit", RPC_RTYPE_NTSTATUS, cmd_shutdown_init, NULL, PI_SHUTDOWN, "Remote Shutdown (over shutdown pipe)",
00112 "syntax: shutdown [-m message] [-t timeout] [-r] [-h] [-f] (-r == reboot, -h == halt, -f == force)" },
00113
00114 { "shutdownabort", RPC_RTYPE_NTSTATUS, cmd_shutdown_abort, NULL, PI_SHUTDOWN, "Abort Shutdown (over shutdown pipe)",
00115 "syntax: shutdownabort" },
00116 #endif
00117 { NULL }
00118 };