From c260d96fadb02c4068c9161f0c30e519a9c9f6ab Mon Sep 17 00:00:00 2001 From: idk Date: Thu, 16 Dec 2021 13:58:19 -0500 Subject: [PATCH] Add plugin test script. usage: ./testplugin.sh name-not-displayname-of-plugin --- testplugin.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 testplugin.sh diff --git a/testplugin.sh b/testplugin.sh new file mode 100644 index 0000000..116a892 --- /dev/null +++ b/testplugin.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash +if [ -z $I2P ]; then + I2P=$HOME/i2p +fi +if [ -z $CONFIG ]; then + CONFIG=$HOME/.i2p +fi +if [ -z $1 ]; then + echo "Please enter the plugin name(example: railroad-linux)" + exit 1 +fi +export PLUGINNAME="$1" +export PLUGIN="$CONFIG/plugins/$PLUGINNAME" +export PLUGINPATH="$PLUGIN/lib/$PLUGINNAME" +export PREARGS="$(cat "$CONFIG/plugins/$PLUGINNAME/clients.config" | grep 'clientApp.0.args' | sed 's|clientApp.0.args=||g' | cut -sf6- -d'-')" +export ARGS=$(echo $PREARGS | sed "s|\$PLUGIN|$PLUGIN|g") +echo "Testing: $PLUGINNAME" +echo "Using environment:" +echo " I2P=$I2P" +echo " CONFIG=$CONFIG" +echo " PLUGIN=$PLUGIN" +"$PLUGINPATH" -$ARGS > log.log 2> err.log & +tail -f log.log err.log +