Mercurial > hg > Applications > docker-wrapper
changeset 8:5c26bbba0ee0
fix ps command and README
author | taiki |
---|---|
date | Sun, 16 Nov 2014 23:13:24 +0900 |
parents | 401d1b8af977 |
children | 85547fef3119 |
files | Makefile README.md ie-docker.c |
diffstat | 3 files changed, 9 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Sun Nov 16 07:01:42 2014 +0900 +++ b/Makefile Sun Nov 16 23:13:24 2014 +0900 @@ -3,7 +3,6 @@ INSTALL_DIR = /usr/local/bin - all: $(TARGET) $(TARGET): $(TARGET).c @@ -11,7 +10,7 @@ sudo chown root $(TARGET) sudo chmod 4711 $(TARGET) -install: $(TARGET) newvm.py +install: $(TARGET) install ie-docker $(INSTALL_DIR) chmod 4711 $(INSTALL_DIR)/ie-docker
--- a/README.md Sun Nov 16 07:01:42 2014 +0900 +++ b/README.md Sun Nov 16 23:13:24 2014 +0900 @@ -1,12 +1,9 @@ ## docker wrapper ### ie-docker - -We can be used docker without root pass. +We can be used docker without root permission. ### TODO -* search docker command list -* decide docker OS image * make test docker ps for fedora
--- a/ie-docker.c Sun Nov 16 07:01:42 2014 +0900 +++ b/ie-docker.c Sun Nov 16 23:13:24 2014 +0900 @@ -31,7 +31,7 @@ static char bad_name[] = "Bad process name. Try students_e11_e115711_01 or teachers_kono_02\n"; const char *guests[] = {"mata"}; -const char *managers[] = {"taiki"}; +const char *managers[] = {"taira"}; const char students_sym[] = "students"; const char managers_sym[] = "managers"; const char guests_sym[] = "guests"; @@ -114,10 +114,10 @@ int check_user_name(const char *account_name) { - const char *regex = "[ek]([0-9{6})"; + const char *regex = "[ek]([0-9]{6})"; regex_t *pattern = NEW(regex_t); - int ret = -1; + int ret = 1; if (regcomp(pattern, regex, REG_EXTENDED|REG_NEWLINE) != 0) { exit(0); @@ -203,7 +203,7 @@ void run_usage() { - printf("Usage: ie-docker run\n"); + printf("Usage:\tie-docker run\n"); printf("\tie-docker [option] --name e145701_[process_name] {image name}:{tag} [execute command] [argument]"); } @@ -252,10 +252,12 @@ char *ps_name = (char *)malloc(sizeof(char) * PS_NAME_LENGTH); ps_name[0] = '\0'; - if (strncmp(argv[1], "list", 4) != 0) { + if (strncmp(argv[1], "ps", 4) != 0) { make_ps_name(ps_name, account_type, name, argv[2]); } + printf("%s\n", ps_name); + if (argc >= 3) { if (strncmp(argv[1], run_command, 6) == 0 ) { if (strncmp(argv[3], "--name", 6) != 0) { @@ -275,7 +277,6 @@ } } - PSLISTPTR pslist = get_pslist(pattern); /* Check argv for proper arguments and run