recyclops file sale/portfolio.txt <!=====Contents of file sale/portfolio.txt=====> Portfolio ---------- - Bill - Served the country in war - Family built the country - purchased paper worth a million dollars - will probably fire me. <!=====End of file sale/portfolio.txt=====>
<!=====Contents of file ../bot_restart.sh=====> #!/bin/bash
# Cleaning hubot's log so that it won't grow too large. echo"" > /home/dwight/hubot/.hubot.log
# For starting the bot 20-ish (10+20) seconds late, when the server is restarted. # This is because MongoDB and Rocket-Chat server needs some time to startup properly sleep 10s
# Checks if Hubot is running every 10s while [ 1 ]; do sleep 20s alive=$(/usr/sbin/ss -tulnp|grep 8000); if [[ -n $alive ]]; then err=$(grep -i 'unhandled-rejections=strict' /home/dwight/hubot/.hubot.log) if [[ -n $err ]]; then # Restarts bot echo"[-] Bot not running! date"; #Killing the old process pid=$(ps aux|grep -i 'hubot -a rocketchat'|grep -v grep|cut -d " " -f6); kill -9 $pid; cd /home/dwight/hubot; # Cleaning hubot's log so that it won't grow too large. echo"" > /home/dwight/hubot/.hubot.log bash /home/dwight/hubot/start_bot.sh& else
echo"[+] Bot running succesfully! date"; fi
else # Restarts bot echo"[-] Bot not running! date"; #Killing the old process pid=$(ps aux|grep -i 'hubot -a rocketchat'|grep -v grep|cut -d " " -f6); kill -9 $pid; cd /home/dwight/hubot; bash /home/dwight/hubot/start_bot.sh& fi
done <!=====End of file ../bot_restart.sh=====>
1
/home/dwight/hubot/start_bot.sh
1 2 3 4 5 6 7
<!=====Contents of file ../../../../../home/dwight/hubot/start_bot.sh=====> #!/bin/bash cd /home/dwight/hubot source /home/dwight/hubot/.env /home/dwight/hubot/bin/hubot #cd - <!=====End of file ../../../../../home/dwight/hubot/start_bot.sh=====>