From 26c32c813018cae0a8e5bfc114060de8cb747ce3 Mon Sep 17 00:00:00 2001 From: Federico Galatolo Date: Thu, 16 Sep 2021 17:13:42 +0200 Subject: [PATCH] ADded run_example script --- run_example.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 run_example.sh diff --git a/run_example.sh b/run_example.sh new file mode 100755 index 0000000..2e104c2 --- /dev/null +++ b/run_example.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +usage(){ + echo "Usage: $0 " + echo "Available exaples are:" + ls ./examples + exit 1 +} + + +if [ "$#" -ne 1 ]; then + usage; +fi + +if [ ! -d "./examples/$1" ]; then + usage; +fi + +name=$(openssl rand -hex 16) + +cd ./examples/"$1" || exit +easyopt create "$name" +easyopt agent "$name" \ No newline at end of file