|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
| 3 | +VERSION=1.3 |
| 4 | +TITLE="Twitch Bot $VERSION" |
3 | 5 |
|
4 | 6 | function installPhpOrDie() { |
5 | | - if (dialog --title "PHP Checks" --yes-button "Yes" --no-button "No" --yesno "Do you want to install PHP and PHP-CURL ?" 10 78); then |
| 7 | + if (dialog --title "$TITLE - PHP Checks" --yes-button "Yes" --no-button "No" --yesno "Do you want to install PHP and PHP-CURL ?" 10 78); then |
6 | 8 | clear |
7 | 9 | apt-get update |
8 | | - apt-get install -y php5-cli php5-curl |
| 10 | + apt-get install -y php-cli php-curl |
9 | 11 | else |
10 | | - dialog --title "Twitch Bot" --msgbox "PHP is required to use this bot, thanks." 10 78 |
| 12 | + dialog --title "$TITLE" --msgbox "PHP is required to use this bot, thanks." 10 78 |
11 | 13 | fi |
12 | 14 | } |
13 | 15 |
|
14 | 16 | # Step 1 |
15 | | -dialog --title "Twitch Bot" --msgbox " |
| 17 | +dialog --title "$TITLE" --msgbox " |
16 | 18 | Welcome to the installer, it checks if your system passes all requirements and configures the bot for you. |
17 | 19 |
|
18 | 20 | Choose Ok to begin." 10 78 |
19 | 21 |
|
20 | 22 |
|
21 | 23 | # Step 2 |
22 | 24 | PHPVERSION=$(php --version 2> /dev/null | head -n 1 | cut -d " " -f 2 | cut -c 1,3); |
23 | | -if [ $PHPVERSION < 56 ] || [ -z $PHPVERSION ]; then |
| 25 | +if [ ${PHPVERSION} < 56 ] || [ -z ${PHPVERSION} ]; then |
24 | 26 | installPhpOrDie |
25 | 27 | fi |
26 | 28 |
|
27 | 29 | # Step 3 |
28 | | -dialog --title "Twitch Bot" --msgbox " |
| 30 | +dialog --title "$TITLE" --msgbox " |
29 | 31 | The next step will download composer on getcomposer.org and install it locally |
30 | 32 |
|
31 | | -Choose Ok to continue." 10 78 |
| 33 | +Choose Ok to continue and wait." 10 78 |
32 | 34 |
|
33 | 35 | wget https://getcomposer.org/installer -O composer-setup.php &> /dev/null |
34 | 36 | php composer-setup.php &> /dev/null |
| 37 | +rm composer-setup.php |
35 | 38 |
|
36 | 39 |
|
37 | 40 | # Step 4 |
38 | | -dialog --title "Twitch Bot" --msgbox " |
| 41 | +dialog --title "$TITLE" --msgbox " |
39 | 42 | To finish, launch composer update by pressing Ok on this step |
40 | 43 |
|
41 | 44 | Choose Ok to continue." 10 78 |
42 | 45 | php composer.phar update &> /dev/null |
43 | 46 |
|
44 | 47 | # Step 5 |
45 | | -dialog --title "Twitch Bot" --msgbox "It' done ! Installation ended successfully. You can launch the bot by typing: bash launch.sh in your terminal" 10 78 |
| 48 | +dialog --title "$TITLE" --msgbox "It' done ! Installation ended successfully. You can launch the bot by typing: bash launch.sh in your terminal" 10 78 |
0 commit comments