25 lines
425 B
C
25 lines
425 B
C
|
#include<stdio.h>
|
||
|
#include<stdlib.h>
|
||
|
#include<string.h>
|
||
|
|
||
|
int main(int argc,char *argv[])
|
||
|
{
|
||
|
const char* id = NULL;
|
||
|
char cmd[100] = "docker stop ";
|
||
|
if(argc>1)
|
||
|
{
|
||
|
id = argv[1];
|
||
|
char addr[40];
|
||
|
sprintf(addr, id);
|
||
|
strcat(cmd, addr);
|
||
|
printf(cmd);
|
||
|
system(cmd);
|
||
|
return 1;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
printf("Please enter the docker id!\n");
|
||
|
return -1;
|
||
|
}
|
||
|
}
|