Blame view

restart_container.sh 392 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
9
10
11
12
13
  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 $PROGRAM -c "mount /proc" &
  PID=$!
  
  ps axo ppid,pid | grep "^ *$PID" | sed -e 's/.* //'