Files
Mattias Walström 8c9c432847 Add a new packet python-statd
Actually a part of statd, but had to make
a separarate package to get it to work.

Statd helper-scripts are now pre-compiled instead of doing it
in runtime.

Fixes #379
2024-04-16 12:47:16 +02:00

30 lines
559 B
Bash
Executable File

#!/bin/sh
SCRIPT_PATH="$(dirname "$(readlink -f "$0")")"
if [ $# -lt 2 ]; then
echo "Usage: $0 JSON-FILE COMMAND [ ARGS ]"
exit 1
fi
json=$1; shift
command=$1; shift
echo "1..1"
if [ ! -e "$SCRIPT_PATH/$json" ]; then
echo "not ok 1 - $SCRIPT_PATH/$json not found"
exit 1
fi
cat "$SCRIPT_PATH/$json" | \
"$SCRIPT_PATH"/../../../src/statd/python/cli_pretty/cli_pretty.py \
"$command" $*
if [ $? -eq 0 ]; then
echo "ok 1 - $json printed without crashing"
exit 0
fi
echo "not ok 1 - $json printing returned non zero"
exit 1