Add helper scripts for the Docker experiments.
This commit is contained in:
parent
df4db3d9b6
commit
34fed726dd
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This script will run the keygen script for a requested amount of times.
|
||||
# It takes an optional integer parameter - amount - for the amount of dockers.
|
||||
# Otherwise it will default to 5.
|
||||
|
||||
usage() {
|
||||
echo "$(basename $0) [number]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -z "$1" ] && AMOUNT=5
|
||||
|
||||
case "$1" in
|
||||
*[!0-9]*)
|
||||
usage
|
||||
;;
|
||||
*)
|
||||
AMOUNT="$1"
|
||||
;;
|
||||
esac
|
||||
|
||||
rm -f onions.txt
|
||||
|
||||
for i in $(seq 1 $AMOUNT); do
|
||||
./keygen
|
||||
done
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This script will start containers that were generated with create.sh
|
||||
|
||||
for i in $(cat onions.txt); do
|
||||
onion="$(echo $i | cut -d':' -f2)"
|
||||
container="$(docker run -d dyne/decodeos:$onion)"
|
||||
echo "Started container $container for $onion"
|
||||
done
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This script will stop and delete the created containers and images.
|
||||
|
||||
containers="$(docker container ls | awk '/dyne\/decodeos:.*\.onion/ {print $1}')"
|
||||
|
||||
echo "$containers" | xargs docker stop
|
||||
echo "$containers" | xargs docker rm
|
||||
|
||||
images="$(docker images | awk '/dyne\/decodeos:.*\.onion/ {print $3}')"
|
||||
|
||||
echo "$images" | xargs docker rmi
|
||||
Loading…
Reference in New Issue