2015-12-09 15:40:38 +01:00
|
|
|
#!/bin/bash
|
2016-06-08 23:21:42 +02:00
|
|
|
# Wrapper to start tool of the VILLASnode suite
|
2015-12-09 15:40:38 +01:00
|
|
|
#
|
2016-06-08 23:21:42 +02:00
|
|
|
# This allows you to use VILLASnode tools like this:
|
|
|
|
# $ villas node /etc/villas/test.cfg
|
2015-12-09 15:40:38 +01:00
|
|
|
#
|
|
|
|
# Install by:
|
|
|
|
# $ make install
|
|
|
|
#
|
2022-03-15 09:18:01 -04:00
|
|
|
# Author: Steffen Vogel <post@steffenvogel.de>
|
2022-03-15 09:28:57 -04:00
|
|
|
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
|
2022-07-04 18:20:03 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2015-12-09 15:40:38 +01:00
|
|
|
|
|
|
|
# Get a list of all available tools
|
2023-06-15 17:49:40 +02:00
|
|
|
SUBTOOLS="api node compare pipe hook conf2json convert graph relay signal test-config test-rtt zmq-keygen"
|
2015-12-09 15:40:38 +01:00
|
|
|
|
|
|
|
# First argument to wrapper is the tool which should be started
|
2021-09-21 16:13:28 +02:00
|
|
|
SUBTOOL=$1
|
2015-12-09 15:40:38 +01:00
|
|
|
|
|
|
|
# Following arguments will be passed directly to tool
|
|
|
|
ARGS=${@:2}
|
|
|
|
|
|
|
|
# Check if tool is available
|
2023-05-26 01:03:14 +02:00
|
|
|
if ! echo ${SUBTOOLS} | grep -wqFe "${SUBTOOL}"; then
|
|
|
|
echo "Usage: villas [-h | --help | TOOL]"
|
2021-09-21 16:13:28 +02:00
|
|
|
echo " TOOL is one of ${SUBTOOLS}"
|
2017-05-05 19:24:16 +00:00
|
|
|
echo
|
2019-03-31 19:58:53 +02:00
|
|
|
echo "For detailed documentation, please see: 'villas node'"
|
|
|
|
echo " http://villas.fein-aachen.org/doc/"
|
2017-03-29 04:04:20 +02:00
|
|
|
echo
|
2019-03-31 19:58:53 +02:00
|
|
|
|
2017-03-29 04:04:20 +02:00
|
|
|
# Show VILLASnode copyright and contact info
|
2017-09-16 23:31:47 +02:00
|
|
|
villas-node -h | tail -n3
|
2023-05-26 01:03:14 +02:00
|
|
|
echo "-h" "--help" | grep -wqFe "${SUBTOOL}"
|
|
|
|
exit $?
|
2015-12-09 15:40:38 +01:00
|
|
|
fi
|
|
|
|
|
2021-09-21 16:13:28 +02:00
|
|
|
exec villas-${SUBTOOL} ${ARGS}
|