From 2c1d7ceae77a9b4e4a87d01a2cf7129e950aca9e Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Fri, 7 Aug 2015 22:32:15 +0200 Subject: [PATCH] fix volume bug --- installer/bin/check.sh | 14 +++++++------- installer/bin/dcres.sh | 8 ++++---- installer/upstart/dionaea.conf | 4 ++-- installer/upstart/elk.conf | 6 +++--- installer/upstart/ews.conf | 6 +++--- installer/upstart/glastopf.conf | 6 +++--- installer/upstart/honeytrap.conf | 4 ++-- installer/upstart/kippo.conf | 6 +++--- installer/upstart/suricata.conf | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/installer/bin/check.sh b/installer/bin/check.sh index d3eff50d..850e0f84 100755 --- a/installer/bin/check.sh +++ b/installer/bin/check.sh @@ -16,17 +16,17 @@ touch /var/run/check.lock myUPTIME=$(awk '{print int($1/60)}' /proc/uptime) for i in $myIMAGES - do + do myCIDSTATUS=$(docker exec $i supervisorctl status) - if [ $? -ne 0 ]; + if [ $? -ne 0 ]; then - myCIDSTATUS=1 - else + myCIDSTATUS=1 + else myCIDSTATUS=$(echo $myCIDSTATUS | egrep -c "(STOPPED|FATAL)") fi - if [ $myCIDSTATUS -gt 0 ]; + if [ $myCIDSTATUS -gt 0 ]; then - if [ $myUPTIME -gt 5 ]; + if [ $myUPTIME -gt 5 ]; then for j in $myIMAGES do @@ -46,7 +46,7 @@ for i in $myIMAGES fi sleep 0.1 done - docker rm $(docker ps -aq) + docker rm -v $(docker ps -aq) for j in $myIMAGES do service $j start diff --git a/installer/bin/dcres.sh b/installer/bin/dcres.sh index b4ffa4a5..35c4fb0c 100755 --- a/installer/bin/dcres.sh +++ b/installer/bin/dcres.sh @@ -16,9 +16,9 @@ myIMAGES=$(cat /data/images.conf) touch /var/run/check.lock myUPTIME=$(awk '{print int($1/60)}' /proc/uptime) -if [ $myUPTIME -gt 5 ]; +if [ $myUPTIME -gt 5 ]; then - for i in $myIMAGES + for i in $myIMAGES do service $i stop done @@ -30,13 +30,13 @@ if [ $myUPTIME -gt 5 ]; if [ $? -ne 0 ]; then echo Docker daemon is still starting. - else + else echo Docker daemon is now available. break fi sleep 0.1 done - docker rm $(docker ps -aq) + docker rm -v $(docker ps -aq) docker rmi $(docker images | grep "^" | awk '{print $3}') for i in $myIMAGES do diff --git a/installer/upstart/dionaea.conf b/installer/upstart/dionaea.conf index b2000bd4..aaaa2fbb 100644 --- a/installer/upstart/dionaea.conf +++ b/installer/upstart/dionaea.conf @@ -14,11 +14,11 @@ pre-start script # Remove any existing dionaea containers myCID=$(docker ps -a | grep dionaea | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi end script script # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) + sleep $(((RANDOM % 5)+5)) /usr/bin/docker run --name dionaea --cap-add=NET_BIND_SERVICE --rm=true -p 21:21 -p 42:42 -p 8080:80 -p 135:135 -p 443:443 -p 445:445 -p 1433:1433 -p 3306:3306 -p 5061:5061 -p 5060:5060 -p 69:69/udp -p 5060:5060/udp -v /data/dionaea dtagdevsec/dionaea end script diff --git a/installer/upstart/elk.conf b/installer/upstart/elk.conf index 0b1496d7..9d82aa9d 100644 --- a/installer/upstart/elk.conf +++ b/installer/upstart/elk.conf @@ -14,11 +14,11 @@ pre-start script # Remove any existing elk containers myCID=$(docker ps -a | grep elk | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi end script script - # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) + # Delayed start to avoid rapid respawning + sleep $(((RANDOM % 5)+5)) /usr/bin/docker run --name=elk --volumes-from ews --volumes-from suricata -v /data/elk/:/data/elk/ -p 127.0.0.1:64296:8080 --rm=true dtagdevsec/elk end script diff --git a/installer/upstart/ews.conf b/installer/upstart/ews.conf index c17790c1..ac6c9ef1 100644 --- a/installer/upstart/ews.conf +++ b/installer/upstart/ews.conf @@ -14,11 +14,11 @@ pre-start script # Remove any existing ews containers myCID=$(docker ps -a | grep ews | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi end script script # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) - /usr/bin/docker run --name ews --volumes-from dionaea --volumes-from glastopf --volumes-from honeytrap --volumes-from kippo --rm=true -v /data/ews/conf/:/data/ews/conf/ -v /data/ews/ --link kippo:kippo dtagdevsec/ews + sleep $(((RANDOM % 5)+5)) + /usr/bin/docker run --name ews --volumes-from dionaea --volumes-from glastopf --volumes-from honeytrap --volumes-from kippo --rm=true -v /data/ews/conf/:/data/ews/conf/ -v /data/ews/ --link kippo:kippo dtagdevsec/ews end script diff --git a/installer/upstart/glastopf.conf b/installer/upstart/glastopf.conf index 06840bed..f17e7dfa 100644 --- a/installer/upstart/glastopf.conf +++ b/installer/upstart/glastopf.conf @@ -14,11 +14,11 @@ pre-start script # Remove any existing glastopf containers myCID=$(docker ps -a | grep glastopf | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi end script script # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) - /usr/bin/docker run --name glastopf --rm=true -p 80:80 -v /data/glastopf dtagdevsec/glastopf + sleep $(((RANDOM % 5)+5)) + /usr/bin/docker run --name glastopf --rm=true -p 80:80 -v /data/glastopf dtagdevsec/glastopf end script diff --git a/installer/upstart/honeytrap.conf b/installer/upstart/honeytrap.conf index 64743ba0..20955e0e 100644 --- a/installer/upstart/honeytrap.conf +++ b/installer/upstart/honeytrap.conf @@ -14,13 +14,13 @@ pre-start script # Remove any existing honeytrap containers myCID=$(docker ps -a | grep honeytrap | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi /sbin/iptables -w -A INPUT -p tcp --syn -m state --state NEW -m multiport ! --dports 21,22,42,80,135,443,445,1433,3306,5060,5061,64295,64296 -j NFQUEUE end script script # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) + sleep $(((RANDOM % 5)+5)) /usr/bin/docker run --name honeytrap --cap-add=NET_ADMIN --net=host --rm=true -v /data/honeytrap dtagdevsec/honeytrap end script post-stop script diff --git a/installer/upstart/kippo.conf b/installer/upstart/kippo.conf index 5655f840..c48aec0e 100644 --- a/installer/upstart/kippo.conf +++ b/installer/upstart/kippo.conf @@ -14,11 +14,11 @@ pre-start script # Remove any existing kippo containers myCID=$(docker ps -a | grep kippo | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi end script script # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) - /usr/bin/docker run --name kippo --rm=true -p 22:2222 -v /data/kippo dtagdevsec/kippo + sleep $(((RANDOM % 5)+5)) + /usr/bin/docker run --name kippo --rm=true -p 22:2222 -v /data/kippo dtagdevsec/kippo end script diff --git a/installer/upstart/suricata.conf b/installer/upstart/suricata.conf index cbdb4428..3f5550ba 100644 --- a/installer/upstart/suricata.conf +++ b/installer/upstart/suricata.conf @@ -14,7 +14,7 @@ pre-start script # Remove any existing suricata containers myCID=$(docker ps -a | grep suricata | awk '{ print $1 }') if [ "$myCID" != "" ]; - then docker rm $myCID; + then docker rm -v $myCID; fi myIF=$(route | grep default | awk '{ print $8 }') /sbin/ethtool --offload $myIF rx off tx off @@ -23,6 +23,6 @@ pre-start script end script script # Delayed start to avoid rapid respawning - sleep $(((RANDOM % 5)+5)) - /usr/bin/docker run --name suricata --cap-add=NET_ADMIN --net=host --rm=true -v /data/suricata/ dtagdevsec/suricata + sleep $(((RANDOM % 5)+5)) + /usr/bin/docker run --name suricata --cap-add=NET_ADMIN --net=host --rm=true -v /data/suricata/ dtagdevsec/suricata end script