Blame view

container.sh 2.13 KB
3e470988   hmalti   First commit
1
  #!/bin/bash
17bfc359   hmalti   Help Image+contai...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  if [ $# -lt 1 ]; then
      printf "Nom \n"
      printf "\t \t Container\n"
      printf "SYNOPSIS \n"
      printf "\t \t baleine container <COMMANDES> [arguments]\n"
      printf "Description: \n \n"
      printf "La commande 'Container' permet de créer des conteneurs, en supprimer, lister les conteneurs existants (Son nom, son image, son bridge, son PID, son starting time ) " 
      printf "Les commandes sont :\n \n"
      printf "\t %-10s %-10s \n" "<create>"  "crée un conteneur."
      printf "\t \t [-i], [NOM_IMAGE]\n \n" 
      printf "\t \t [-c], [NOM_CONTAINER]\n \n"
      printf "\t \t [-b], [NOM_BRIDGE]\n \n"
      printf "\t \t [-r], [REPERTOIRE]\n \n"
      printf "\t \t [-a], [ADDRE_IPV4]\n \n"
      printf "\t \t [-p], [NOM_PROGRAMME]\n \n"
      printf " \t %-10s %-10s \n" "<list> "  "liste les conteneurs existants ainsi que leurs manifestes."
      printf " \t %-10s %-10s \n" "<remove> "  "Supprime le conteneur donné en argument."
      printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" 
      printf "\t \t %-10s %-10s \n" "<exec> "  "Exécute au lancement du conteneur un bash."
      printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" 
      printf "\t %-10s %-10s \n" "<stop> "  "Stop le conteneur donné en argument."
      printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" 
      printf " \t %-10s %-10s \n" "<restart> "  "redémarre le conteneur donné en argument."
      printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" 
      printf "Utilisez baleine <commande> help pour plus d'informations à propos d'une commande.\n"
  fi
3e470988   hmalti   First commit
28
  
5721892d   hmalti   Avancées
29
  case $1 in
3e470988   hmalti   First commit
30
31
32
  
      "create")
          #Si on veut creer un container (qu'on a apellé le script ./baleine.sh container create)
5721892d   hmalti   Avancées
33
          bash create_container.sh "${@:2}"
3e470988   hmalti   First commit
34
35
36
          ;;
      "list")
          #Si on veut lister les containers qui tournent (qu'on a apellé le script ./baleine.sh container list)
5721892d   hmalti   Avancées
37
          bash list_container.sh "${@:2}"
3e470988   hmalti   First commit
38
39
          ;;
      "stop")
5721892d   hmalti   Avancées
40
          bash stop_container.sh "${@:2}"
3e470988   hmalti   First commit
41
          ;;
b1087939   hmalti   Ajout commandes
42
      "remove")
5721892d   hmalti   Avancées
43
          bash remove_container.sh "${@:2}"
b1087939   hmalti   Ajout commandes
44
45
          ;;
      "restart")
5721892d   hmalti   Avancées
46
          bash restart_container.sh "${@:2}"
5161dfdb   hmalti   Améliorations scr...
47
48
          ;;  
      "exec")
5721892d   hmalti   Avancées
49
          bash exec_container.sh "${@:2}"
5161dfdb   hmalti   Améliorations scr...
50
          ;;        
3e470988   hmalti   First commit
51
52
   
  esac