├── .gitignore ├── LICENSE ├── README.md └── ebot-install.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Build and Release Folders 2 | bin/ 3 | bin-debug/ 4 | bin-release/ 5 | [Oo]bj/ # FlashDevelop obj 6 | [Bb]in/ # FlashDevelop bin 7 | 8 | # Other files and folders 9 | .settings/ 10 | 11 | # Executables 12 | *.swf 13 | *.air 14 | *.ipa 15 | *.apk 16 | 17 | # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` 18 | # should NOT be excluded as they contain compiler settings and other important 19 | # information for Eclipse / Flash Builder. 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Vincent DOUROUX 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ebot-install-script 2 | Ebot-CSGO install Script 3 | 4 | Please use it on debian 8. Others versions will come later. 5 | 6 | You can find Ebot-CSGO here: https://github.com/deStrO/eBot-CSGO 7 | 8 | RUN IT AS ROOT 9 | 10 | wget https://raw.githubusercontent.com/vince52/eBot-install-script/master/ebot-install.sh && chmod +x ebot-install.sh 11 | ./ebot-install.sh 12 | 13 | # CREDIT 14 | Destr0 (ebot original project) 15 | -------------------------------------------------------------------------------- /ebot-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Installer for Ebot-CSGO and Ebot-WEB by Vince52 3 | 4 | # This script will work on Debian and Ubuntu 5 | # This is not bullet-proof. So I'm not responsible 6 | # of anything if you use this script. 7 | # If you see anything wrong, please let me know here: 8 | # http://forum.esport-tools.net/d/94-ebot-auto-install-script 9 | 10 | 11 | # Detect Debian users running the script with "sh" instead of bash 12 | if readlink /proc/$$/exe | grep -qs "dash"; then 13 | echo "This script needs to be run with bash, not sh" 14 | exit 1 15 | fi 16 | 17 | if [[ "$EUID" -ne 0 ]]; then 18 | echo "Sorry, you need to run this as root" 19 | exit 2 20 | fi 21 | 22 | if [[ -e /etc/debian_version ]]; then 23 | OS=debian 24 | GROUPNAME=nogroup 25 | RCLOCAL='/etc/rc.local' 26 | else 27 | echo "Looks like you aren't running this installer on Debian or Ubuntu" 28 | exit 5 29 | fi 30 | 31 | # Try to get our IP from the system and fallback to the Internet. 32 | # CHECK NAT 33 | IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1) 34 | if [[ "$IP" = "" ]]; then 35 | echo '1' 36 | IP=$(wget -qO- api.ipify.org) 37 | fi 38 | 39 | if [[ -e /home/ebot/ebot-csgo/config/config.ini ]]; then 40 | while : 41 | do 42 | 43 | echo "Looks like Ebot-CSGO is already on your server" 44 | echo "" 45 | echo "What do you want to do?" 46 | echo " 1) Start Ebot-CSGO Daemon" 47 | echo " 2) Stop Ebot-CSGO Daemon" 48 | echo " 3) Restart Ebot-CSGO daemon" 49 | echo " 4) Clear cache Ebot-web" 50 | echo " 5) Secure mysql" 51 | echo " 6) Delete EBOT (coming soon)" 52 | echo " 7) Update Ebot (coming soon)" 53 | echo " 8) Exit" 54 | read -p "Select an option [1-5]: " option 55 | case $option in 56 | 1) 57 | echo "" 58 | echo "Staring Ebot-CSGO... (need to be set)" 59 | service ebot start 60 | exit 61 | ;; 62 | 2) 63 | echo "Stoping Ebot-CSGO" 64 | service ebot stop 65 | exit 66 | ;; 67 | 3) 68 | echo "Restarting Ebot-CSGO" 69 | service ebot restart 70 | exit 71 | ;; 72 | 4) 73 | echo "Clearing Cache" 74 | service ebot clear-cache 75 | exit 76 | ;; 77 | 5) 78 | echo "Securing mysql" 79 | mysql_secure_installation 80 | exit 81 | ;; 82 | 6) 83 | echo "(coming soon)" 84 | exit 85 | ;; 86 | 7) 87 | echo "(coming soon)" 88 | exit 89 | ;; 90 | 8) exit;; 91 | esac 92 | done 93 | else 94 | clear 95 | echo 'Welcome to Ebot 3.2 installer by vince52' 96 | echo "" 97 | # Some questions for users 98 | echo "I need to ask you a few questions before starting the setup" 99 | echo "You can leave the default options and just press enter if you are ok with them" 100 | echo "" 101 | echo "First I need to know the IPv4 address of the network interface you want Ebot" 102 | echo "listening to." 103 | read -p "IP address: " -e -i $IP IP 104 | echo "" 105 | echo "Install ebot on sub domain or not?" 106 | echo " 1) On my own Sub-domain" 107 | echo " 2) On my public IP" 108 | read -p "your choice [1-2]: " -e -i 1 SUBORIP 109 | echo "" 110 | if [[ "$SUBORIP" -eq 1 ]]; then 111 | echo "Finally, tell me your sub-domain you where you want to install ebot" 112 | echo "Please, replace your it by your domain" 113 | read -p "Sub-domain name: " -e -i ebot.yourdomain.com SUBDOMAIN 114 | fi 115 | echo "" 116 | echo "Okay, I will ask you other questions later." 117 | read -n1 -r -p "Press any key to continue..." 118 | 119 | # 2) Install SERVER-REQUIREMENTS 120 | apt-get update 121 | apt-get install apache2 gcc make libxml2-dev autoconf ca-certificates unzip nodejs curl libcurl4-openssl-dev pkg-config libssl-dev screen -y 122 | if [ $? != 0 ]; then 123 | echo "(LINE 126) There is an error. Are you running apt application somewhere?" 124 | echo "Can you check your debian source list?" 125 | echo "ABORT" 126 | exit 127 | fi 128 | # 3) INSTALL PHP 129 | 130 | # If PHP is already installed, removing it. 131 | apt-get autoremove php5 php5-dev php5-cli php php-dev php-cli -y 132 | #if [ $? != 0 ]; then 133 | # echo "(LINE 126) There is an error. Are you running apt application somewhere?" 134 | # echo "Can you check your debian source list?" 135 | # echo "ABORT" 136 | # exit 137 | #fi 138 | 139 | # COMPILE AND INSTALL THE NEW PHP VERSION: 140 | mkdir /home/install 141 | cd /home/install 142 | wget http://be2.php.net/get/php-5.6.37.tar.bz2/from/this/mirror -O php-5.6.37.tar.bz2 143 | tar -xjvf php-5.6.37.tar.bz2 144 | cd php-5.6.37 145 | ./configure --prefix /usr/local --with-mysql --enable-maintainer-zts --enable-sockets --with-openssl --with-pdo-mysql 146 | make 147 | make install 148 | cd /home/install 149 | wget http://pecl.php.net/get/pthreads-2.0.10.tgz 150 | tar -xvzf pthreads-2.0.10.tgz 151 | cd pthreads-2.0.10 152 | /usr/local/bin/phpize 153 | ./configure 154 | make 155 | make install 156 | echo 'date.timezone = Europe/Paris' >> /usr/local/lib/php.ini 157 | echo 'extension=pthreads.so' >> /usr/local/lib/php.ini 158 | 159 | apt-get install libapache2-mod-php5 php5-curl -y 160 | if [ $? != 0 ]; then 161 | echo "(LINE 162) There is an error. Are you running apt application somewhere?" 162 | echo "Can you check your debian source list?" 163 | echo "ABORT" 164 | exit 165 | fi 166 | 167 | # 4) INSTALL & CONFIG MYSQL SERVER (NEED TO FINISH IT) 168 | 169 | if [[ ! -e /etc/mysql/conf.d ]]; then 170 | echo "Okay, Mysql is not installed." 171 | echo "This script will install it for you" 172 | echo "You will need to set a MYSQL's root password" 173 | echo "" 174 | echo "Here is an example of a good and random password:" 175 | rootpasswd=$(openssl rand -base64 12) 176 | echo $rootpasswd 177 | echo "DON'T FORGET TO REMEMBER IT IF IT IS DIFFERENT THAN THIS ONE" 178 | echo "YOU WILL NEED IT AFTER FOR EBOT!!!" 179 | read -n1 -r -p "Press any key to continue..." 180 | 181 | apt-get install mysql-server -y 182 | if [ $? != 0 ]; then 183 | echo "(LINE 183) There is an error. Are you running the APT application somewhere?" 184 | echo "Can you check your debian source list?" 185 | echo "ABORT" 186 | exit 187 | fi 188 | 189 | fi 190 | 191 | # create random password 192 | SQLPASSWORDEBOTV3="$(openssl rand -base64 12)" 193 | 194 | # If /root/.my.cnf exists then it won't ask for root password 195 | if [ -f /root/.my.cnf ]; then 196 | 197 | mysql -e "CREATE DATABASE ebotv3;" 198 | mysql -e "CREATE USER ebotv3@localhost IDENTIFIED BY '$SQLPASSWORDEBOTV3';" 199 | mysql -e "GRANT ALL PRIVILEGES ON ebotv3.* TO 'ebotv3'@'localhost';" 200 | mysql -e "FLUSH PRIVILEGES;" 201 | 202 | # If /root/.my.cnf doesn't exist then it'll ask for root password 203 | else 204 | echo "Please enter root user MySQL password!" 205 | read -p "YOUR SQL ROOT PASSWORD: " -e -i $rootpasswd rootpasswd 206 | until mysql -u root -p$mysqlRootPassword -e ";" ; do 207 | read -p "Can't connect, please retry: " -e -i $rootpasswd rootpasswd 208 | done 209 | mysql -u root -p$rootpasswd -e "CREATE DATABASE ebotv3;" 210 | mysql -u root -p$rootpasswd -e "CREATE USER ebotv3@localhost IDENTIFIED BY '$SQLPASSWORDEBOTV3';" 211 | mysql -u root -p$rootpasswd -e "GRANT ALL PRIVILEGES ON ebotv3.* TO 'ebotv3'@'localhost';" 212 | mysql -u root -p$rootpasswd -e "FLUSH PRIVILEGES;" 213 | fi 214 | 215 | apt-get install php5-mysql -y 216 | if [ $? != 0 ]; then 217 | echo "(LINE 213) There is an error. Are you running apt application somewhere?" 218 | echo "Can you check your debian source list?" 219 | echo "ABORT" 220 | exit 221 | fi 222 | 223 | # Variables to be set: $SQLPASSWORDEBOTV3 224 | 225 | # 5) INSTALL EBOT-CSGO 226 | 227 | mkdir /home/ebot 228 | cd /home/ebot 229 | wget https://github.com/deStrO/eBot-CSGO/archive/master.zip 230 | unzip master.zip 231 | mv eBot-CSGO-master ebot-csgo 232 | cd ebot-csgo 233 | curl --silent --location https://deb.nodesource.com/setup_0.12 | bash - 234 | 235 | apt-get install -y nodejs 236 | if [ $? != 0 ]; then 237 | echo "(LINE 232) There is an error. Are you running apt application somewhere?" 238 | echo "Can you check your debian source list?" 239 | echo "ABORT" 240 | exit 241 | fi 242 | 243 | npm install socket.io@0.9.12 archiver@0.4.10 formidable 244 | curl -sS https://getcomposer.org/installer | php 245 | php composer.phar install 246 | # Command line of my ebot guide: cp config/config.ini.smp config/config.ini 247 | 248 | EXTERNALIP=$(wget -qO- ipv4.icanhazip.com) 249 | EXTIP="" 250 | if [[ "$IP" != "$EXTERNALIP" ]]; then 251 | echo "" 252 | echo "Looks like your server is behind a NAT!" 253 | echo "" 254 | echo "If your server is NATed (e.g. LowEndSpirit), I need to know the external IP" 255 | echo "If that's not the case, just ignore this and leave the next field blank" 256 | read -p "External IP: " -e USEREXTERNALIP 257 | if [[ "$USEREXTERNALIP" != "" ]]; then 258 | EXTIP=$USEREXTERNALIP 259 | fi 260 | fi 261 | 262 | 263 | # Generate config.ini (need SQL DATABASE HERE $SQLPASSWORDEBOTV3) 264 | echo '; eBot - A bot for match management for CS:GO 265 | ; @license http://creativecommons.org/licenses/by/3.0/ Creative Commons 3.0 266 | ; @author Julien Pardons 267 | ; @version 3.0 268 | ; @date 21/10/2012 269 | [BDD] 270 | MYSQL_IP = "127.0.0.1" 271 | MYSQL_PORT = "3306" 272 | MYSQL_USER = "ebotv3" 273 | MYSQL_PASS = "'$SQLPASSWORDEBOTV3'" 274 | MYSQL_BASE = "ebotv3" 275 | [Config] 276 | BOT_IP = "'$IP'" 277 | BOT_PORT = 12360 278 | EXTERNAL_LOG_IP = "'$EXTIP'" ; use this in case your server isnt binded with the external IP (behind a NAT) 279 | MANAGE_PLAYER = 1 280 | DELAY_BUSY_SERVER = 120 281 | NB_MAX_MATCHS = 0 282 | PAUSE_METHOD = "nextRound" ; nextRound or instantConfirm or instantNoConfirm 283 | NODE_STARTUP_METHOD = "node" ; binary file name or none in case you are starting it with forever or manually 284 | [Match] 285 | LO3_METHOD = "restart" ; restart or csay or esl 286 | KO3_METHOD = "restart" ; restart or csay or esl 287 | DEMO_DOWNLOAD = true ; true or false :: whether gotv demos will be downloaded from the gameserver after matchend or not 288 | REMIND_RECORD = false ; true will print the 3x "Remember to record your own POV demos if needed!" messages, false will not 289 | DAMAGE_REPORT = true; true will print damage reports at end of round to players, false will not 290 | [MAPS] 291 | MAP[] = "de_cache" 292 | MAP[] = "de_season" 293 | MAP[] = "de_dust2" 294 | MAP[] = "de_nuke" 295 | MAP[] = "de_inferno" 296 | MAP[] = "de_train" 297 | MAP[] = "de_mirage" 298 | MAP[] = "de_cbble" 299 | MAP[] = "de_overpass" 300 | [WORKSHOP IDs] 301 | [Settings] 302 | COMMAND_STOP_DISABLED = false 303 | RECORD_METHOD = "matchstart" ; matchstart or knifestart 304 | DELAY_READY = true' > /home/ebot/ebot-csgo/config/config.ini 305 | 306 | 307 | 308 | 309 | # 6) INSTALL EBOT-WEB 310 | 311 | cd /home/ebot 312 | rm -R master* 313 | wget https://github.com/deStrO/eBot-CSGO-Web/archive/master.zip 314 | unzip master.zip 315 | mv eBot-CSGO-Web-master ebot-web 316 | cd ebot-web 317 | # cp config/app_user.yml.default config/app_user.yml 318 | 319 | # Generate app_user.yml 320 | echo "# ---------------------------------------------------------------------- 321 | # white space are VERY important, don't remove it or it will not work 322 | # ---------------------------------------------------------------------- 323 | log_match: ../../ebot-csgo/logs/log_match 324 | log_match_admin: ../../ebot-csgo/logs/log_match_admin 325 | demo_path: ../../ebot-csgo/demos 326 | # true or false, whether demos will be downloaded by the ebot server 327 | # the demos can be downloaded at the matchpage, if it's true 328 | demo_download: true 329 | ebot_ip: "$IP" 330 | ebot_port: 12360 331 | # lan or net, it's to display the server IP or the GO TV IP 332 | # net mode display only started match on home page 333 | mode: lan 334 | # set to 0 if you don't want a refresh 335 | refresh_time: 30 336 | # Toornament Configuration 337 | toornament_id: 338 | toornament_secret: 339 | toornament_api_key: 340 | toornament_plugin_key: test-123457890" > /home/ebot/ebot-web/config/app_user.yml 341 | 342 | # Generate databases.yml 343 | rm /home/ebot/ebot-web/config/databases.yml 344 | echo "# You can find more information about this file on the symfony website: 345 | # http://www.symfony-project.org/reference/1_4/en/07-Databases 346 | all: 347 | doctrine: 348 | class: sfDoctrineDatabase 349 | param: 350 | dsn: mysql:host=127.0.0.1;dbname=ebotv3 351 | username: ebotv3 352 | password: $SQLPASSWORDEBOTV3" > /home/ebot/ebot-web/config/databases.yml 353 | 354 | cd /home/ebot 355 | cd ebot-web 356 | mkdir cache 357 | chown -R www-data * 358 | chmod -R 777 cache 359 | 360 | php symfony cc 361 | php symfony doctrine:build --all --no-confirmation 362 | 363 | #ASK USER USERNAME AND PASSWORD 364 | echo "THE LAST QUESTION: I need a username and a password for ebot" 365 | read -p "Username: " -e -i admin EBOTUSER 366 | read -p "Password: " -e -i password EBOTPASSWORD 367 | php symfony guard:create-user --is-super-admin admin@ebot $EBOTUSER $EBOTPASSWORD 368 | 369 | # 7) CONFIG APACHE 370 | a2enmod rewrite 371 | 372 | # IF INSTALL IS FOR A SUB-DOMAIN 373 | if [[ "$SUBORIP" -eq 1 ]]; then 374 | echo " 375 | #Edit your email 376 | ServerAdmin contact@mydomain.com 377 | #Edit your sub-domain 378 | ServerAlias $SUBDOMAIN 379 | DocumentRoot /home/ebot/ebot-web/web 380 | 381 | Options Indexes FollowSymLinks MultiViews 382 | AllowOverride All 383 | 384 | Order allow,deny 385 | allow from all 386 | 387 | = 2.4> 388 | Require all granted 389 | 390 | 391 | " > /etc/apache2/sites-available/ebotv3.conf 392 | 393 | 394 | 395 | 396 | a2ensite ebotv3.conf 397 | 398 | else 399 | echo "Alias / /home/ebot/ebot-web/web/ 400 | 401 | AllowOverride All 402 | 403 | Order allow,deny 404 | allow from all 405 | 406 | = 2.4> 407 | Require all granted 408 | 409 | " > /etc/apache2/sites-available/ebotv3.conf 410 | 411 | echo "Options +FollowSymLinks +ExecCGI 412 | 413 | RewriteEngine On 414 | # uncomment the following line, if you are having trouble 415 | # getting no_script_name to work 416 | RewriteBase / 417 | # we skip all files with .something 418 | #RewriteCond %{REQUEST_URI} \..+$ 419 | #RewriteCond %{REQUEST_URI} !\.html$ 420 | #RewriteRule .* - [L] 421 | # we check if the .html version is here (caching) 422 | RewriteRule ^$ index.html [QSA] 423 | RewriteRule ^([^.]+)$ $1.html [QSA] 424 | RewriteCond %{REQUEST_FILENAME} !-f 425 | # no, so we redirect to our front web controller 426 | RewriteRule ^(.*)$ index.php [QSA,L] 427 | " > /home/ebot/ebot-web/web/.htaccess 428 | 429 | a2ensite ebotv3.conf 430 | fi 431 | 432 | service apache2 reload 433 | 434 | # 8) Start/Stop ebot daemon 435 | 436 | cd /home/install 437 | wget https://raw.githubusercontent.com/vince52/eBot-initscript/master/ebotv3; mv ebotv3 /etc/init.d/ebot && chmod +x /etc/init.d/ebot 438 | service ebot start 439 | /etc/init.d/ebot start 440 | 441 | 442 | # 9) SECURITY ??? (COMING SOON) 443 | 444 | # Finished 445 | 446 | echo "" 447 | echo "Finished!" 448 | echo "" 449 | #If ebot-web is on subdomain 450 | if [[ "$SUBORIP" -eq 1 ]]; then 451 | echo "You can access to eBot-WEB interface here: http://$SUBDOMAIN" 452 | else 453 | echo "You can access to ebot client here: http://$IP" 454 | fi 455 | echo "Username: $EBOTUSER" 456 | echo "Password: $EBOTPASSWORD" 457 | echo "" 458 | fi 459 | --------------------------------------------------------------------------------