Blame view

restart_container.sh 446 Bytes
b1087939   hmalti   Ajout commandes
1
  #!/bin/bash
5721892d   hmalti   Avancées
2
3
4
5
6
7
  while getopts c:i: o; do
      case $o in
          (c) NOM_CONTAINER=$OPTARG;;
          (i) NOM_IMAGE=$OPTARG;;    
      esac
  done
b1087939   hmalti   Ajout commandes
8
  
b02be524   hmalti   Correctifs + gest...
9
10
  mount -t ext4 -o loop $PATH_BALEINE/containers/$NOM_CONTAINER/$NOM_IMAGE /mnt/baleine/$NOM_CONTAINER
  nohup unshare -p -f -m -n -u chroot /mnt/baleine/$NOM_CONTAINER /bin/sh -c "mount /proc ; $PROGRAM ; while true ; do sleep 10 ; done" &
b1087939   hmalti   Ajout commandes
11
12
  PID=$!
  
b02be524   hmalti   Correctifs + gest...
13
14
15
  
  #TODO: *Rajouter les interfaces réseau au container
  #      *