1
0
tiger-bot/run.sh

29 lines
697 B
Bash
Raw Normal View History

2024-09-24 21:25:49 +00:00
#!/bin/bash
set -e
2019-03-06 20:50:36 +00:00
LOG_SERVER_TO_CLIENT=./log_s2c.log
LOG_CLIENT_TO_SERVER=./log_c2s.log
2024-09-24 21:25:49 +00:00
TARGET_SERVER="irc.example.org"
2019-03-06 20:50:36 +00:00
CLIENT_RUNTIME="./tiger-bot.bin"
2024-09-24 21:25:49 +00:00
COMMS_RUNTIME="openssl s_client -connect $TARGET_SERVER:6697"
2019-03-06 20:50:36 +00:00
# Ensure logs are new
rm -f "$LOG_CLIENT_TO_SERVER"
rm -f "$LOG_SERVER_TO_CLIENT"
touch "$LOG_CLIENT_TO_SERVER"
touch "$LOG_SERVER_TO_CLIENT"
# Begin communication
echo "Beginning connection..."
tail -f -n 0 "$LOG_CLIENT_TO_SERVER" | eval $COMMS_RUNTIME >> "$LOG_SERVER_TO_CLIENT" &
echo "Waiting for SSL handshake to complete..."
sleep 1
echo "Starting bot..."
tail -f -n 0 "$LOG_SERVER_TO_CLIENT" | eval $CLIENT_RUNTIME >> "$LOG_CLIENT_TO_SERVER"
#echo "Bot started!..."