From 0e55170396bff5c383c51f04b30a04b6eace2088 Mon Sep 17 00:00:00 2001 From: hmalti Date: Thu, 9 May 2019 18:48:06 +0200 Subject: [PATCH] Corrections --- baleine.sh | 3 --- container.sh | 3 --- create_bridge.sh | 3 +++ create_image.sh | 2 +- restart_container.sh | 15 --------------- test.sh | 10 ---------- 6 files changed, 4 insertions(+), 32 deletions(-) mode change 100644 => 100755 baleine.sh delete mode 100644 restart_container.sh delete mode 100644 test.sh diff --git a/baleine.sh b/baleine.sh old mode 100644 new mode 100755 index 985a195..3a19ac6 --- a/baleine.sh +++ b/baleine.sh @@ -38,7 +38,4 @@ case "$1" in "help") bash help.sh ;; - "test") - bash test.sh "${@:2}" - ;; esac \ No newline at end of file diff --git a/container.sh b/container.sh index 01d0bbf..2f69106 100644 --- a/container.sh +++ b/container.sh @@ -40,9 +40,6 @@ case $1 in "remove") bash remove_container.sh "${@:2}" ;; - "restart") - bash restart_container.sh "${@:2}" - ;; "exec") bash exec_container.sh "${@:2}" ;; diff --git a/create_bridge.sh b/create_bridge.sh index 05208ec..2ffa119 100644 --- a/create_bridge.sh +++ b/create_bridge.sh @@ -14,12 +14,15 @@ if [[ -z "$NOM_BRIDGE" ]]; then exit fi #création du bridge +echo "Création du bridge $NOM_BRIDGE" ip link add $NOM_BRIDGE type bridge #attribution d'une adresse ip au bridge +echo "Attribution de l'adresse ip $ADDR_IPV4 à $NOM_BRIDGE" ip a add dev $NOM_BRIDGE $ADDR_IPV4 #demarrage du bridge +echo "Demarrage de $NOM_BRIDGE" ip link set $NOM_BRIDGE down ip link set $NOM_BRIDGE up diff --git a/create_image.sh b/create_image.sh index 1996427..1f99ddb 100644 --- a/create_image.sh +++ b/create_image.sh @@ -59,7 +59,7 @@ if [[ $PROXY != "" ]]; then fi #Création de l'arborescence Debian avec debootstrap -echo "Je vais faire le debootstrap" +echo "Debut du debootstrap" mkdir -p /mnt/baleine/$NOM_IMAGE mount -t ext4 -o loop $REPERTOIRE/$NOM_IMAGE /mnt/baleine/$NOM_IMAGE debootstrap --include=apache2,vim,nano stable /mnt/baleine/$NOM_IMAGE diff --git a/restart_container.sh b/restart_container.sh deleted file mode 100644 index 1eabfc0..0000000 --- a/restart_container.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -while getopts c:i: o; do - case $o in - (c) NOM_CONTAINER=$OPTARG;; - (i) NOM_IMAGE=$OPTARG;; - esac -done - -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" & -PID=$! - - -#TODO: *Rajouter les interfaces réseau au container -# * \ No newline at end of file diff --git a/test.sh b/test.sh deleted file mode 100644 index 823cb33..0000000 --- a/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#bash baleine.sh bridge create mybridge 192.168.42.1 -#bash baleine.sh container create -i TEST -c mycontainer -b mybridge -a 192.168.42.2 -p /usr/sbin/apache2 - - -PATH_IMAGE="/var/lib/baleine/images" -NOM_IMAGE="myimage" -PATH_BALEINE="/var/lib/baleine" -NOM_CONTAINER="mycontainer" - -cp $PATH_IMAGE/$NOM_IMAGE $PATH_BALEINE/containers/$NOM_CONTAINER/$NOM_IMAGE \ No newline at end of file -- libgit2 0.21.2