Commit 0e55170396bff5c383c51f04b30a04b6eace2088
1 parent
2afb9b1f
Corrections
Showing
6 changed files
with
4 additions
and
32 deletions
Show diff stats
container.sh
@@ -40,9 +40,6 @@ case $1 in | @@ -40,9 +40,6 @@ case $1 in | ||
40 | "remove") | 40 | "remove") |
41 | bash remove_container.sh "${@:2}" | 41 | bash remove_container.sh "${@:2}" |
42 | ;; | 42 | ;; |
43 | - "restart") | ||
44 | - bash restart_container.sh "${@:2}" | ||
45 | - ;; | ||
46 | "exec") | 43 | "exec") |
47 | bash exec_container.sh "${@:2}" | 44 | bash exec_container.sh "${@:2}" |
48 | ;; | 45 | ;; |
create_bridge.sh
@@ -14,12 +14,15 @@ if [[ -z "$NOM_BRIDGE" ]]; then | @@ -14,12 +14,15 @@ if [[ -z "$NOM_BRIDGE" ]]; then | ||
14 | exit | 14 | exit |
15 | fi | 15 | fi |
16 | #création du bridge | 16 | #création du bridge |
17 | +echo "Création du bridge $NOM_BRIDGE" | ||
17 | ip link add $NOM_BRIDGE type bridge | 18 | ip link add $NOM_BRIDGE type bridge |
18 | 19 | ||
19 | #attribution d'une adresse ip au bridge | 20 | #attribution d'une adresse ip au bridge |
21 | +echo "Attribution de l'adresse ip $ADDR_IPV4 à $NOM_BRIDGE" | ||
20 | ip a add dev $NOM_BRIDGE $ADDR_IPV4 | 22 | ip a add dev $NOM_BRIDGE $ADDR_IPV4 |
21 | 23 | ||
22 | #demarrage du bridge | 24 | #demarrage du bridge |
25 | +echo "Demarrage de $NOM_BRIDGE" | ||
23 | ip link set $NOM_BRIDGE down | 26 | ip link set $NOM_BRIDGE down |
24 | ip link set $NOM_BRIDGE up | 27 | ip link set $NOM_BRIDGE up |
25 | 28 |
create_image.sh
@@ -59,7 +59,7 @@ if [[ $PROXY != "" ]]; then | @@ -59,7 +59,7 @@ if [[ $PROXY != "" ]]; then | ||
59 | fi | 59 | fi |
60 | 60 | ||
61 | #Création de l'arborescence Debian avec debootstrap | 61 | #Création de l'arborescence Debian avec debootstrap |
62 | -echo "Je vais faire le debootstrap" | 62 | +echo "Debut du debootstrap" |
63 | mkdir -p /mnt/baleine/$NOM_IMAGE | 63 | mkdir -p /mnt/baleine/$NOM_IMAGE |
64 | mount -t ext4 -o loop $REPERTOIRE/$NOM_IMAGE /mnt/baleine/$NOM_IMAGE | 64 | mount -t ext4 -o loop $REPERTOIRE/$NOM_IMAGE /mnt/baleine/$NOM_IMAGE |
65 | debootstrap --include=apache2,vim,nano stable /mnt/baleine/$NOM_IMAGE | 65 | debootstrap --include=apache2,vim,nano stable /mnt/baleine/$NOM_IMAGE |
restart_container.sh deleted
@@ -1,15 +0,0 @@ | @@ -1,15 +0,0 @@ | ||
1 | -#!/bin/bash | ||
2 | -while getopts c:i: o; do | ||
3 | - case $o in | ||
4 | - (c) NOM_CONTAINER=$OPTARG;; | ||
5 | - (i) NOM_IMAGE=$OPTARG;; | ||
6 | - esac | ||
7 | -done | ||
8 | - | ||
9 | -mount -t ext4 -o loop $PATH_BALEINE/containers/$NOM_CONTAINER/$NOM_IMAGE /mnt/baleine/$NOM_CONTAINER | ||
10 | -nohup unshare -p -f -m -n -u chroot /mnt/baleine/$NOM_CONTAINER /bin/sh -c "mount /proc ; $PROGRAM ; while true ; do sleep 10 ; done" & | ||
11 | -PID=$! | ||
12 | - | ||
13 | - | ||
14 | -#TODO: *Rajouter les interfaces réseau au container | ||
15 | -# * | ||
16 | \ No newline at end of file | 0 | \ No newline at end of file |
test.sh deleted
@@ -1,10 +0,0 @@ | @@ -1,10 +0,0 @@ | ||
1 | -#bash baleine.sh bridge create mybridge 192.168.42.1 | ||
2 | -#bash baleine.sh container create -i TEST -c mycontainer -b mybridge -a 192.168.42.2 -p /usr/sbin/apache2 | ||
3 | - | ||
4 | - | ||
5 | -PATH_IMAGE="/var/lib/baleine/images" | ||
6 | -NOM_IMAGE="myimage" | ||
7 | -PATH_BALEINE="/var/lib/baleine" | ||
8 | -NOM_CONTAINER="mycontainer" | ||
9 | - | ||
10 | -cp $PATH_IMAGE/$NOM_IMAGE $PATH_BALEINE/containers/$NOM_CONTAINER/$NOM_IMAGE | ||
11 | \ No newline at end of file | 0 | \ No newline at end of file |