From d49c51c9efdd11b881db8dad99d88128b9933dd4 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 9 Dec 2015 15:40:38 +0100 Subject: [PATCH] added new wrapper to start S2SS tools example: $ s2ss server /etc/test.conf --- .gitignore | 2 ++ Makefile | 7 ++++--- tools/s2ss.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100755 tools/s2ss.sh diff --git a/.gitignore b/.gitignore index a924c53a6..e7a19f16e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ server pipe test random + +thirdparty/ diff --git a/Makefile b/Makefile index baa162b4a..15c67e4fa 100644 --- a/Makefile +++ b/Makefile @@ -87,12 +87,13 @@ libs2ss.so: $(LIB_OBJS) $(CC) $(LIB_LDFLAGS) $(LIB_LDLIBS) -shared -o $@ $^ # Common targets -install: $(TARGETS) +install: $(TARGETS) $(LIBS) install -m 0644 libs2ss.so $(PREFIX)/lib - install -m 0755 server -T $(PREFIX)/bin/s2ss + install -m 0755 server -T $(PREFIX)/bin/s2ss-server + install -m 0755 random $(PREFIX)/bin/s2ss-random install -m 0755 pipe $(PREFIX)/bin/s2ss-pipe - install -m 0755 signal $(PREFIX)/bin/s2ss-signal install -m 0755 test $(PREFIX)/bin/s2ss-test + install -m 0755 tools/s2ss.sh $(PREFIX)/bin/s2ss release: all tar czf s2ss-$(COMMIT)-docs.tar.gz documentation/html/ diff --git a/tools/s2ss.sh b/tools/s2ss.sh new file mode 100755 index 000000000..3db0f4c11 --- /dev/null +++ b/tools/s2ss.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Wrapper to start tool of the S2SS suite +# +# This allows you to use S2SS tools like this: +# $ s2ss server /etc/cosima/test.cfg +# +# Install by: +# $ make install +# +# @author Steffen Vogel +# @copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC +# This file is part of S2SS. All Rights Reserved. Proprietary and confidential. +# Unauthorized copying of this file, via any medium is strictly prohibited. +# +################################################################################## + +PREFIX=s2ss + +# Get a list of all available tools +TOOLS=$(compgen -c | egrep "^$PREFIX-" | sort | cut -d- -f2 | paste -sd\|) + +# First argument to wrapper is the tool which should be started +TOOL=$1 + +# Following arguments will be passed directly to tool +ARGS=${@:2} + +# Check if tool is available +if ! [[ "$TOOL" =~ $(echo ^\($TOOLS\)$) ]]; then + echo "Usage s2ss ($TOOLS)" 1>&2 + exit 1 +fi + +exec $PREFIX-$TOOL $ARGS \ No newline at end of file