Commit 17bfc35906abd57f02454a22499d300f42ddf459
1 parent
055618a3
Help Image+container+bridge
Showing
9 changed files
with
84 additions
and
26 deletions
Show diff stats
bridge.sh
1 | 1 | #!/bin/bash |
2 | +if [ $# -lt 1 ]; then | |
3 | + printf "Nom \n" | |
4 | + printf "\t \t Bridge\n" | |
5 | + printf "SYNOPSIS \n" | |
6 | + printf "\t \t baleine bridge <COMMANDES> [arguments]\n" | |
7 | + printf "Description: \n \n" | |
8 | + printf "La commande 'bridge' permet de créer des bridges Linux, en supprimer et lister les bridges existants (Nom) " | |
9 | + printf "Les commandes sont :\n \n" | |
10 | + printf "\t %-10s %-10s \n" "<create>" "crée un bridge." | |
11 | + printf "\t \t [-b], [NOM_BRIDGE]\n \n" | |
12 | + printf "\t \t [-a], [ADDR_IPV4]\n \n" | |
13 | + printf " \t %-10s %-10s \n" "<list>" "liste les bridges existants ainsi que leurs manifestes." | |
14 | + printf " \t %-10s %-10s \n" "<remove>" "Supprime le bridge donné en argument." | |
15 | + printf "\t \t [-b], --bridge [NOM_BRIDGE]\n \n" | |
16 | + printf " \t %-10s %-10s \n" "<up>" "Met up le bridge donné en argument." | |
17 | + printf "\t \t [-b], --bridge [NOM_BRIDGE]\n \n" | |
18 | + printf " \t %-10s %-10s \n" "<down>" "Met down le bridge donné en argument." | |
19 | + printf "\t \t [-b], --bridge [NOM_BRIDGE]\n \n" | |
2 | 20 | |
21 | + printf "Utilisez baleine <commande> help pour plus d'informations à propos d'une commande.\n" | |
22 | +fi | |
3 | 23 | case $1 in |
4 | 24 | |
5 | 25 | "create") | ... | ... |
container.sh
1 | 1 | #!/bin/bash |
2 | +if [ $# -lt 1 ]; then | |
3 | + printf "Nom \n" | |
4 | + printf "\t \t Container\n" | |
5 | + printf "SYNOPSIS \n" | |
6 | + printf "\t \t baleine container <COMMANDES> [arguments]\n" | |
7 | + printf "Description: \n \n" | |
8 | + 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 ) " | |
9 | + printf "Les commandes sont :\n \n" | |
10 | + printf "\t %-10s %-10s \n" "<create>" "crée un conteneur." | |
11 | + printf "\t \t [-i], [NOM_IMAGE]\n \n" | |
12 | + printf "\t \t [-c], [NOM_CONTAINER]\n \n" | |
13 | + printf "\t \t [-b], [NOM_BRIDGE]\n \n" | |
14 | + printf "\t \t [-r], [REPERTOIRE]\n \n" | |
15 | + printf "\t \t [-a], [ADDRE_IPV4]\n \n" | |
16 | + printf "\t \t [-p], [NOM_PROGRAMME]\n \n" | |
17 | + printf " \t %-10s %-10s \n" "<list> " "liste les conteneurs existants ainsi que leurs manifestes." | |
18 | + printf " \t %-10s %-10s \n" "<remove> " "Supprime le conteneur donné en argument." | |
19 | + printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" | |
20 | + printf "\t \t %-10s %-10s \n" "<exec> " "Exécute au lancement du conteneur un bash." | |
21 | + printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" | |
22 | + printf "\t %-10s %-10s \n" "<stop> " "Stop le conteneur donné en argument." | |
23 | + printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" | |
24 | + printf " \t %-10s %-10s \n" "<restart> " "redémarre le conteneur donné en argument." | |
25 | + printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" | |
26 | + printf "Utilisez baleine <commande> help pour plus d'informations à propos d'une commande.\n" | |
27 | +fi | |
2 | 28 | |
3 | 29 | case $1 in |
4 | 30 | ... | ... |
create_container.sh
... | ... | @@ -69,7 +69,7 @@ echo "PID Unshare :$PID" |
69 | 69 | FILE=$NOM_CONTAINER.manifest |
70 | 70 | date=$(date) |
71 | 71 | |
72 | -echo "nom_container:$NOM_CONTAINER" >> $FILE #nom de son image | |
72 | +echo "nom_container:$NOM_CONTAINER" >> $FILE #nom du conteneur | |
73 | 73 | echo "nom_image:$NOM_IMAGE" >> $FILE #nom de son image |
74 | 74 | echo "pid:$PID" >> $FILE #Son PID |
75 | 75 | echo "nom_bridge:$NOM_BRIDGE" >> $FILE #SON BRIDGE | ... | ... |
exec_container.sh
help.sh
1 | 1 | #!/bin/bash |
2 | 2 | printf "Baleine est un outil simple de gestion de conteneur.\n" |
3 | 3 | printf "Utilisation: \n \n" |
4 | - printf "\t \t image <commande> [arguments]\n" | |
5 | - printf "Les commandes sont :\n \n" | |
6 | - printf "\t \t %-10s %-10s \n" "create <NOM_IMAGE> <TAILLE_IMAGE> <REPERTOIRE_IMAGE>" "Créer une image " | |
7 | - printf "\t \t %-10s %-10s \n" "list <>" "Liste le manifest de chaque image." | |
8 | - printf "\t \t %-10s %-10s \n \n" "remove <NOM_IMAGE_A_SUPPRIMER>" "supprime l'image passée en argument " | |
9 | - | |
10 | - printf "\t \t bridge <commande> [arguments]\n" | |
11 | - printf "Les commandes sont :\n \n" | |
12 | - printf "\t \t %-10s %-10s \n" "create <NOM_IMAGE> <TAILLE_IMAGE> <REPERTOIRE_IMAGE>" "Créer une image avec " | |
13 | - printf "\t \t %-10s %-10s \n" "list <>" "Liste le manifest de chaque image." | |
14 | - printf "\t \t %-10s %-10s \n \n" "remove <NOM_IMAGE_A_SUPPRIMER>" "supprime l'image passée en argument " | |
15 | - | |
16 | - printf "\t \t container <commande> [arguments]\n" | |
17 | - printf "Les commandes sont :\n \n" | |
18 | - printf "\t \t %-10s %-10s \n" "create <NOM_IMAGE> <TAILLE_IMAGE> <REPERTOIRE_IMAGE>" "Créer une image avec " | |
19 | - printf "\t \t %-10s %-10s \n" "list <>" "Liste le manifest de chaque image." | |
20 | - printf "\t \t %-10s %-10s \n \n" "remove <NOM_IMAGE_A_SUPPRIMER>" "supprime l'image passée en argument " | |
21 | - | |
22 | 4 | \ No newline at end of file |
5 | + | |
23 | 6 | \ No newline at end of file | ... | ... |
image.sh
1 | 1 | #!/bin/bash |
2 | +if [ $# -lt 1 ]; then | |
3 | + printf "Nom \n" | |
4 | + printf "\t \t Image\n" | |
5 | + printf "SYNOPSIS \n" | |
6 | + printf "\t \t baleine image <COMMANDES> [arguments]\n" | |
7 | + printf "Description: \n \n" | |
8 | + printf "La commande 'image' permet de créer une image, en supprimer, lister les images existantes (Son nom, sa taille, son chemin ) " | |
9 | + printf "Les commandes sont :\n \n" | |
10 | + printf "\t %-10s %-10s \n" "<create>" "crée une image." | |
11 | + printf "\t \t [-i], [NOM_IMAGE]\n \n" | |
12 | + printf "\t \t [-s], [TAILLE]\n \n" | |
13 | + printf "\t \t [-r], [REPERTOIRE]\n \n" | |
14 | + printf "\t \t [-P], [PROXY]\n \n" | |
15 | + printf " \t %-10s %-10s \n" "<list>" "liste les images existantes ainsi que leurs manifestes." | |
16 | + printf " \t %-10s %-10s \n" "<remove>" "Supprime l'image donnée en argument." | |
17 | + printf "\t \t [-c], --container [NOM_CONTAINER]\n \n" | |
18 | + printf "Utilisez baleine <commande> help pour plus d'informations à propos d'une commande.\n" | |
19 | +fi | |
20 | + | |
2 | 21 | |
3 | 22 | case $1 in |
4 | 23 | "create") | ... | ... |
remove_bridge.sh
1 | 1 | #!/bin/bash |
2 | 2 | NAME_BRIDGE_TO_REMOVE=$1; |
3 | - | |
3 | +while getopts b: o; do | |
4 | + case $o in | |
5 | + (b) NAME_BRIDGE_TO_REMOVE=$OPTARG;; | |
6 | + esac | |
7 | +done | |
4 | 8 | #vérification que l'utilisateur donne bien un nom à l'image |
5 | 9 | if [[ -z "$NAME_BRIDGE_TO_REMOVE" ]]; then |
6 | 10 | echo "Il faut donner le nom du bridge à supprimer ! Relancez la commande avec les bons arguments." | ... | ... |
remove_container.sh
1 | 1 | #!/bin/bash |
2 | -NAME_CONTAINER_TO_REMOVE=$1; | |
3 | - | |
2 | +while getopts c: o; do | |
3 | + case $o in | |
4 | + (c) NAME_CONTAINER_TO_REMOVE=$OPTARG;; | |
5 | + esac | |
6 | +done | |
4 | 7 | #vérification que l'utilisateur donne bien un nom à l'CONTAINER |
5 | 8 | if [[ -z "$NAME_CONTAINER_TO_REMOVE" ]]; then |
6 | 9 | echo "Il faut donner le NAME du conteneur! Relancez la commande avec les bons arguments." | ... | ... |
remove_image.sh
1 | 1 | #!/bin/bash |
2 | -NAME_IMAGE_TO_REMOVE=$1; | |
3 | - | |
2 | +while getopts i: o; do | |
3 | + case $o in | |
4 | + (i) NAME_IMAGE_TO_REMOVE=$OPTARG;; | |
5 | + esac | |
6 | +done | |
4 | 7 | #vérification que l'utilisateur donne bien un nom à l'image |
5 | 8 | if [[ -z "$NAME_IMAGE_TO_REMOVE" ]]; then |
6 | 9 | echo "Il faut donner le nom de l'image ! Relancez la commande avec les bons arguments." | ... | ... |