Skip to content

Instantly share code, notes, and snippets.

@rainbowdashlabs
Last active May 20, 2022 11:35
Show Gist options
  • Save rainbowdashlabs/20d7ad959b524056a406aeb6ee53b4e2 to your computer and use it in GitHub Desktop.
Save rainbowdashlabs/20d7ad959b524056a406aeb6ee53b4e2 to your computer and use it in GitHub Desktop.
Reputation bot setup
echo "Create a directory for our bot"
mkdir repbot
# Enter it
cd repbot
# Get the reputation bot repository
git clone https://github.com/RainbowDashLabs/reputation-bot.git repo
echo "Copy logging config into config directory"
mkdir config
cp repo/src/main/resources/log4j2.xml config/log4j2.xml
echo "Getting scripts for running and upgrading"
wget -q https://gist.githubusercontent.com/RainbowDashLabs/323b0f8f1fdf67c226f63202b440df73/raw/loop.sh
wget -q https://gist.githubusercontent.com/RainbowDashLabs/323b0f8f1fdf67c226f63202b440df73/raw/start.sh
wget -q https://gist.githubusercontent.com/RainbowDashLabs/323b0f8f1fdf67c226f63202b440df73/raw/upgrade.sh
echo "Applying adjustements on the base scripts to make them work with the reputation bot"
sed -i 's/my_jar.jar/rep-bot.jar/' loop.sh
sed -i 's/<jvm args>/-Dlog4j.configurationFile=config\/log4j2.xml -Dbot.config=config\/config.json/' loop.sh
sed -i 's/<screen_name>/repbot/' start.sh
sed -i 's/<shadowJar\/build>/shadowJar/' upgrade.sh
sed -i 's/my_jar/rep-bot/g' upgrade.sh
echo "Setting up file configurations"
chmod +x loop.sh
chmod +x start.sh
chmod +x upgrade.sh
echo "Building bot jar and copy to base directory"
./upgrade.sh
echo "Launch the bot the first time to create a config file."
java -Xms256m -Xmx2048m -Dlog4j.configurationFile=config/log4j2.xml -Dbot.config=config/config.json -jar ./rep-bot.jar
echo "Please configure the bot config in config/config.json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment