prepare for emobility

This commit is contained in:
Marco Ochse
2016-02-08 12:21:03 +01:00
parent 63ba812446
commit ebb58955c4
11 changed files with 59 additions and 33 deletions

View File

@ -0,0 +1,31 @@
########################################################
# T-Pot #
# Elasticpot upstart script #
# #
# v16.03.4 by ms/mo, DTAG, 2016-02-08 #
########################################################
description "ElasticPot"
author "ms"
start on started docker and filesystem
stop on runlevel [!2345]
respawn
pre-start script
# Remove any existing elasticpot containers
myCID=$(docker ps -a | grep elasticpot | awk '{ print $1 }')
if [ "$myCID" != "" ];
then docker rm -v $myCID;
fi
# Remove any data from previous container
rm -rf /data/elasticpot/* || true
mkdir -p /data/elasticpot/log
chmod 760 /data/elasticpot -R
chown tpot:tpot /data/elasticpot -R
end script
script
/usr/bin/docker run --name elasticpot --rm=true -v /data/elasticpot:/data/elasticpot -v /data/ews:/data/ews -p 9200:8080 dtagdevsec/elasticpot:latest1603
end script
post-start script
# Delay next start to avoid rapid respawning
sleep $(((RANDOM % 5)+5))
end script