#!/bin/bash BLUE='\033[0;34m' GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[0;33m' echo -e "${GREEN}=======================================================" echo -e "${GREEN} _ ___ (_) / __)_ ____ _ ____| |__| |_ _ _ _ | \| |/ _ | __) _) | | | | | | | ( ( | | | | |_| | | | |_|_|_|_|\_|| |_| \___)____| (_____| fb-bot-starter v1.0 love every word bot MIT License https://migftw.com/donate " echo -e "${GREEN}=======================================================" echo -e "${GREEN}Run this script after creating your FB page." echo -e "${GREEN}And please proceed if you've an FB access token." echo -e "${GREEN}You can generate one from maxbots.ddns.net/token" echo -e "${GREEN}=======================================================" read -r -p "Are You Ready? [Y/n] " input case $input in [yY][eE][sS]|[yY]) echo "Yes" ;; [nN][oO]|[nN]) echo "Aight...imma head out" return;; *) echo "Invalid input...imma head out" exit 1 ;; esac echo -e "${GREEN}=======================================================" echo -e "${GREEN}Cool. let's do it then!" echo -e "${GREEN}=======================================================" echo -e "${GREEN}Updating packages" apt-get update echo -e "${GREEN}=======================================================" echo -e "${GREEN}Installing Python 3.8" apt-get install -y python3.8 echo -e "${GREEN}=======================================================" echo -e "${GREEN}Installing pip3" apt-get install -y python3-pip echo -e "${GREEN}=======================================================" echo -e "${GREEN}Installing tmux" apt-get install -y tmux echo -e "${GREEN}=======================================================" echo -e "${GREEN}Killing tmux session with the name lewbot (if there's any)" tmux kill-session -t lewbot echo -e "${GREEN}=======================================================" echo -e "${GREEN}Installing git" apt-get install -y git echo -e "${GREEN}=======================================================" echo -e "${GREEN}Installing facebook-sdk python module." pip3 install facebook-sdk echo -e "${GREEN}=======================================================" echo -e "${GREEN}Installing schedule python module." pip3 install schedule echo -e "${GREEN}=======================================================" echo -e "${GREEN}Creating /lewbot folder" mkdir lewbot echo -e "${GREEN}=======================================================" echo -e "${GREEN}Changing working directory to /lewbot" cd lewbot echo -e "${GREEN}=======================================================" echo -e "${GREEN}Download the love Every Bot Python script" wget -N https://gist.githubusercontent.com/migftw/e07fe8106b82af627d2dd8528175a099/raw/4f324dea929ba5730069d8340bd1adc3442b9b8a/main.py echo -e "${GREEN}=======================================================" echo -e "${GREEN}Download the words.txt (466k words)" wget -N https://github.com/migftw/english-words/raw/master/words.txt echo -e "${GREEN}=======================================================" echo -n "Enter your FB token: " read answer sed -i -e s/fbtoken/"$answer"/g /root/lewbot/main.py echo -e "${GREEN}=======================================================" echo -e "${GREEN}Starting the tmux session." tmux new-session -d -s lewbot 'python3 main.py' echo -e "${GREEN}=======================================================" echo -e "That's about it. The bot is running in the background." echo -e "${GREEN}=======================================================" echo -e "In case you've copy-pasted a wrong token, don't worry." echo -e "You can edit the token field inside main.py anytime. " echo -e "${GREEN}=======================================================" echo -e "Run tmux a -t lewbot to view the process. "