-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper scripts for the Docker experiments.
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |