changeset 52:e45676e6b6cd

add dockerg command
author anatofuz
date Mon, 16 Dec 2019 18:25:54 +0900
parents fecd206e005f
children 35f7a96b14db
files ie-virsh.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ie-virsh.c	Tue Jan 30 22:22:07 2018 +0900
+++ b/ie-virsh.c	Mon Dec 16 18:25:54 2019 +0900
@@ -29,6 +29,7 @@
 #define console_command "console"
 #define debug_command "debug"
 #define define_gdb_command "define-gdb"
+#define docker_comand "dockerg"
 
 
 const char *guests[] = {"145165B"};
@@ -144,7 +145,7 @@
 void
 usage()
 {
-    printf("Usage: COMMAND [define|define-gdb|list|start|destroy|dumpxml|vncdisplay|undefine|console] [vm-name]\n");
+    printf("Usage: COMMAND [define|define-gdb|list|start|destroy|dumpxml|vncdisplay|undefine|console|dockergroup] [vm-name]\n");
     printf("   vm-name should be 01 - 04\n");
 }
 
@@ -385,6 +386,10 @@
         if (execl(command, command, define_command, xml_name, NULL) < 0) {
             perror("Execl:");
         }
+    } else if ( strncmp(argv[1], docker_comand, 7) == 0 ) {
+        if (execl("/sbin/usermod","/sbin/usermod", "-aG", "docker", name, NULL) < 0) {
+            perror("Execl:");
+        }
     } else if ( strncmp(argv[1], undefine_command, 8) == 0 ) {
         /* chdir("/usr/local/etc/libvirt/qemu"); */
         chdir("/etc/libvirt/qemu");