Add plugin test script. usage: ./testplugin.sh name-not-displayname-of-plugin

This commit is contained in:
idk
2021-12-16 13:58:19 -05:00
parent 7c60896370
commit c260d96fad

24
testplugin.sh Normal file
View File

@ -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