├── fivem.service.old ├── txadmin.service.old ├── README.md ├── sh-fivem.sh.old ├── sh-demo.sh.old └── sh-fivem-new.sh /fivem.service.old: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=SH-FIVEM 3 | 4 | [Service] 5 | WorkingDirectory=/home/fivem/ 6 | ExecStart=/bin/sh /home/fivem/run.sh +exec server.cfg 7 | KillMode=process 8 | Type=simple 9 | Restart=always 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /txadmin.service.old: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=SH-FIVEM_TXADMIN 3 | 4 | [Service] 5 | WorkingDirectory=/home/fivem/ 6 | ExecStart=/bin/sh /home/fivem/run.sh +set serverProfile dev_sh-fivem +set txAdminPort 40121 7 | KillMode=process 8 | Type=simple 9 | Restart=always 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installation automatique pour un serveur fivem avec mysql uniquement sur DEBIAN 11 2 | 3 | Fatigué d'être géré par un hébergeur GAME et vous souhaitez avoir un VPS ou un serveur dédié pour votre serveur sous LINUX. 4 | Mais vous savez qu'il est compliqué de gérer un serveur linux avec l'installation de MYSQL, PHPMYADMIN, Artefacts LATEST RECOMMENDED FIVEM, la création d'un identifiant MYSQL pour PHPMYADMIN. 5 | 6 | Mais vous avez SH-FIVEM qui est un script installant correctement votre serveur avec UPDATE en cas de nouveaux artefacts ou de nouvelles dépendances. 7 | 8 | Alors arrêtez de faire les fous avec échec de l'installation en raison d'une documentation périmée ! 9 | 10 | Si vous avez besoin d'aide ou avez une question sur le script, contactez-moi sur discord par Clashplayer#2134 11 | 12 | Psss merci à MathiAs2Pique pour les quelques modifications :) 13 | 14 | # Ubuntu n'est plus supporté par ce script. 15 | 16 | 17 | # Si BASH n'est pas installé : 18 | ``` 19 | apt install bash 20 | ``` 21 | 22 | # Lien de l'installation : 23 | ``` 24 | bash <(wget -O - 'https://raw.githubusercontent.com/Clashplayer-PROTECT/sh-fivem/master/sh-fivem-new.sh') 25 | ``` 26 | 27 | # Update UpdateArtefact 28 | ``` 29 | ./sh-fivem-new.sh 30 | ``` 31 | 32 | 33 | # Vous souhaitre crée un deuxième user ? 34 | ``` 35 | sudo mysql -u root 36 | CREATE USER 'TON-USER'@'localhost' IDENTIFIED BY 'TON-MOT-DE-PASSE'; 37 | GRANT ALL PRIVILEGES ON *.* TO 'TON-USER'@'localhost'; 38 | FLUSH PRIVILEGES; 39 | quit 40 | ``` 41 | 42 | 43 | 44 | 45 | ## Démarage de votre serveur sans la nouvelle technologie ! 46 | ``` 47 | cd /home/fivem 48 | bash /home/fivem/run.sh +exec server.cfg 49 | ``` 50 | Durée de l'installation sur un VPS OVH : 04:49.625 51 | 52 | 53 | # FIN DE LA MAINTENANCE SYSTEME DE UBUNTU 18.04 54 | # 20/01/2023 55 | # Passage sous DEBIAN 11.5 56 | -------------------------------------------------------------------------------- /sh-fivem.sh.old: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script Auto Install Five M 3 | #===================================================================================== 4 | # Author: Clashplayer#3630 5 | #===================================================================================== 6 | #===================================================================================== 7 | # Root Force 8 | # By Clashplayer#8772 9 | 10 | cat << "EOF" 11 | /$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$ 12 | /$$__ $$| $$ | $$ | $$_____/|_ $$_/| $$ | $$| $$_____/| $$$ /$$$ | $$ | $$ /$$__ $$ /$$$$ 13 | | $$ \__/| $$ | $$ | $$ | $$ | $$ | $$| $$ | $$$$ /$$$$ | $$ | $$|__/ \ $$ |_ $$ 14 | | $$$$$$ | $$$$$$$$ /$$$$$$| $$$$$ | $$ | $$ / $$/| $$$$$ | $$ $$/$$ $$ | $$ / $$/ /$$$$$$/ | $$ 15 | \____ $$| $$__ $$|______/| $$__/ | $$ \ $$ $$/ | $$__/ | $$ $$$| $$ \ $$ $$/ /$$____/ | $$ 16 | /$$ \ $$| $$ | $$ | $$ | $$ \ $$$/ | $$ | $$\ $ | $$ \ $$$/ | $$ | $$ 17 | | $$$$$$/| $$ | $$ | $$ /$$$$$$ \ $/ | $$$$$$$$| $$ \/ | $$ \ $/ | $$$$$$$$ /$$ /$$$$$$ 18 | \______/ |__/ |__/ |__/ |______/ \_/ |________/|__/ |__/ \_/ |________/|__/|______/ 19 | EOF 20 | #Supported systems: 21 | supported="Ubuntu" 22 | COLOR1='\033[0;32m' #green color 23 | COLOR2='\033[0;31m' #red color 24 | COLOR3='\33[0;33m' 25 | NC='\033[0m' #no color 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | printf "${RED}ERREUR : SH-FIVEM n'a pas accès root. ⛔️\\n" 1>&2 29 | printf "\\n" 30 | exit 1 31 | fi 32 | printf "${COLOR1} Plus besoin du screen avec la version 2.1 de \\n" 33 | printf "${COLOR1}©️ Copyright Tous droits réservés.©️ \\n" 34 | printf "${COLOR2}💻 Systèmes pris en charge : $supported 💻\\n" 35 | printf "${NC}\\n" 36 | sleep 6 37 | ############################################################################# 38 | 39 | # Prérequis installation Five M 40 | apt update -y 41 | apt upgrade -y 42 | apt install sudo xz-utils git curl screen -y 43 | 44 | #Installation de 5104 45 | echo 46 | printf "${YELLOW} LAST NEW Artifacts : Souhaitez-vous instalaltion du serveur Five M avec la version de 5104 ❓ [o/N]\\n" 47 | read reponse 48 | if [[ "$reponse" == "o" ]] 49 | then 50 | printf "${CYAN} Démarrage de l'instalaltion de version de 5104 pour serveur Five M !" 51 | cd /home/ 52 | mkdir -p fivem 53 | cd /home/fivem 54 | wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/5848-4f71128ee48b07026d6d7229a60ebc5f40f2b9db/fx.tar.xz 55 | tar xvfJ fx.tar.xz 56 | # Suppression du cache automatique 57 | # sed -i '1irm -r cache' run.sh 58 | rm fx.tar.xz 59 | fi 60 | sleep 2 61 | 62 | #Installation de SYSTEMCTL 63 | echo 64 | printf "${YELLOW} Vous souhaitez disposer d'une nouvelle technologie pour démarrer votre serveur fivem ? ❓ [o/N]\\n" 65 | read reponse 66 | if [[ "$reponse" == "o" ]] 67 | then 68 | printf "${CYAN} Démarrage technologie pour démarrer votre serveur fivem !" 69 | cd /etc/systemd/system 70 | wget https://raw.githubusercontent.com/Clashplayer-PROTECT/sh-fivem/master/fivem.service 71 | systemctl enable fivem.service 72 | fi 73 | sleep 2 74 | 75 | #Installation de SYSTEMCTL | TXADMIN 76 | echo 77 | printf "${YELLOW} Vous souhaitez disposer d'une nouvelle technologie pour démarrer votre serveur TXADMIN ? ❓ [o/N]\\n" 78 | read reponse 79 | if [[ "$reponse" == "o" ]] 80 | then 81 | printf "${CYAN} Démarrage technologie pour démarrer votre serveur TXADMIN !" 82 | cd /etc/systemd/system 83 | wget https://raw.githubusercontent.com/Clashplayer-PROTECT/sh-fivem/master/txadmin.service 84 | systemctl enable txadmin.service 85 | fi 86 | sleep 2 87 | 88 | # Installation MARIADB 89 | echo 90 | printf "${YELLOW} Souhaitez-vous créer une installation automatique de MariaDB ❓ [o/N]\\n" 91 | read reponse 92 | if [[ "$reponse" == "o" ]] 93 | then 94 | printf "${CYAN} Démarrage de l'instalaltion de MariaDB pour serveur FiveM !" 95 | apt -y install software-properties-common curl apt-transport-https ca-certificates gnupg 96 | LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php 97 | add-apt-repository -y ppa:chris-lea/redis-server 98 | curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash 99 | apt update -y 100 | sudo add-apt-repository ppa:ondrej/php 101 | sudo apt-get update -y 102 | sudo apt-get install php-mbstring php-gettext 103 | sudo apt -y install php7.4 104 | apt install -y php7.4-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip} mariadb-client mariadb-server apache2 tar unzip git 105 | php -v 106 | 107 | fi 108 | sleep 2 109 | 110 | echo -n -e "${GREEN}Quel est le nom de votre base de données ❓ ${YELLOW}(sh_base)${reset}: " 111 | read -r DBNAME 112 | 113 | if [[ "$DBNAME" == "" ]]; then 114 | DBNAME="sh_base" 115 | fi 116 | 117 | sleep 2 118 | echo -n -e "${GREEN}Quel est l'utilisateur de votre base de données ❓ ${YELLOW}(sh-fivem)${reset}: " 119 | read -r DBUSER 120 | 121 | if [[ "$DBUSER" == "" ]]; then 122 | DBUSER="sh-fivem" 123 | fi 124 | 125 | sleep 2 126 | echo -n -e "${GREEN}Quel est le mot de passe de votre base de données ❓ ${reset}: " 127 | read -s -r DBPASS 128 | 129 | while true; do 130 | 131 | if [[ "$DBPASS" == "" ]]; then 132 | echo -e "${red}Le mot de passe doit être obligatoire !" 133 | echo -n -e "${GREEN}Quel est le mot de passe de votre base de données ❓ ${reset}: " 134 | read -s -r DBPASS 135 | else 136 | echo -e "${GREEN}Le mot de passe est correct !${reset}" 137 | break 138 | fi 139 | done 140 | 141 | 142 | #Installation PHPMYADMIN 143 | echo 144 | printf "${YELLOW} Souhaitez-vous crée une installation automatique de PHPMYADMIN ❓ [o/N]\\n" 145 | read reponse 146 | if [[ "$reponse" == "o" ]] 147 | then 148 | printf "${CYAN} Démarrage de l'instalaltion de phpMyAdmin pour serveur Five M !" 149 | apt install phpmyadmin 150 | sudo service apache2 restart 151 | ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin 152 | fi 153 | 154 | echo -e "Configuration de la utilisateur" 155 | echo "Mettre le mot de passe root de MySQL" 156 | sleep 2 157 | mysql -e "CREATE USER '${DBUSER}'@'localhost' IDENTIFIED BY '${DBPASS}';" 158 | mysql -e "CREATE DATABASE ${DBNAME};" 159 | mysql -p -e "GRANT ALL PRIVILEGES ON * . * TO '${DBUSER}'@'localhost';" 160 | mysql -e "FLUSH PRIVILEGES;" 161 | 162 | 163 | sleep 3 164 | printf "${COLOR3} L'installation est terminée ! \\n" 165 | printf "${COLOR3} Discord de SH-FIVEM : https://discord.gg/Bx5UUV54mu \\n" 166 | printf "${COLOR3} Github de Clahsplayer sur SH-FIVEM: https://github.com/Clashplayer-PROTECT/sh-fivem \\n" 167 | echo -en '\n' 168 | sleep 3 169 | printf "${COLOR1} TOPO du MySQL \\n" 170 | printf "${COLOR1} Lien du phpMyAdmin : http://$(hostname -I)/phpmyadmin/ \\n" 171 | printf "${COLOR1} Nom d'utilisateur de la base de données MySQL: ${DBUSER}\\n" 172 | printf "${COLOR1} Mot de passe de connexion base de données MySQL: ${DBPASS} \\n" 173 | echo -en '\n' 174 | sleep 3 175 | printf "${COLOR2}💻 TOPO sur créaction de votre seveur ! \\n" 176 | printf "${COLOR2}💻 Chemin du dossier : /home/fivem \\n" 177 | printf "${COLOR2}💻 Ne surtout pas supprime run.sh et alpine\\n" 178 | printf "${NC}\\n" 179 | 180 | 181 | cat << "EOF" 182 | /$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$ 183 | /$$__ $$| $$ | $$ | $$_____/|_ $$_/| $$ | $$| $$_____/| $$$ /$$$ | $$ | $$ /$$__ $$ /$$$$ 184 | | $$ \__/| $$ | $$ | $$ | $$ | $$ | $$| $$ | $$$$ /$$$$ | $$ | $$|__/ \ $$ |_ $$ 185 | | $$$$$$ | $$$$$$$$ /$$$$$$| $$$$$ | $$ | $$ / $$/| $$$$$ | $$ $$/$$ $$ | $$ / $$/ /$$$$$$/ | $$ 186 | \____ $$| $$__ $$|______/| $$__/ | $$ \ $$ $$/ | $$__/ | $$ $$$| $$ \ $$ $$/ /$$____/ | $$ 187 | /$$ \ $$| $$ | $$ | $$ | $$ \ $$$/ | $$ | $$\ $ | $$ \ $$$/ | $$ | $$ 188 | | $$$$$$/| $$ | $$ | $$ /$$$$$$ \ $/ | $$$$$$$$| $$ \/ | $$ \ $/ | $$$$$$$$ /$$ /$$$$$$ 189 | \______/ |__/ |__/ |__/ |______/ \_/ |________/|__/ |__/ \_/ |________/|__/|______/ 190 | EOF 191 | -------------------------------------------------------------------------------- /sh-demo.sh.old: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script Auto Install Five M [DEV] 3 | #===================================================================================== 4 | # Author: Clashplayer#2134 5 | #===================================================================================== 6 | #===================================================================================== 7 | # Root Force 8 | # By Clashplayer#2134 9 | 10 | #Supported systems: 11 | supported="Ubuntu" 12 | COLOR1='\033[0;32m' #green color 13 | COLOR2='\033[0;31m' #red color 14 | COLOR3='\33[0;33m' 15 | COLOR4='\033[1;35m' 16 | NC='\033[0m' #no color 17 | 18 | 19 | function installFIVEM() { 20 | cat << "EOF" 21 | /$$$$$$ /$$ /$$ /$$$$$$$ /$$$$$$$$ /$$$$$$$$ /$$$$$$ 22 | /$$__ $$| $$ | $$ | $$__ $$| $$_____/|__ $$__//$$__ $$ 23 | | $$ \__/| $$ | $$ | $$ \ $$| $$ | $$ | $$ \ $$ 24 | | $$$$$$ | $$$$$$$$ /$$$$$$| $$$$$$$ | $$$$$ | $$ | $$$$$$$$ 25 | \____ $$| $$__ $$|______/| $$__ $$| $$__/ | $$ | $$__ $$ 26 | /$$ \ $$| $$ | $$ | $$ \ $$| $$ | $$ | $$ | $$ 27 | | $$$$$$/| $$ | $$ | $$$$$$$/| $$$$$$$$ | $$ | $$ | $$ 28 | \______/ |__/ |__/ |_______/ |________/ |__/ |__/ |__/ 29 | EOF 30 | #Supported systems: 31 | supported="Debian 11" 32 | COLOR1='\033[0;32m' #green color 33 | COLOR2='\033[0;31m' #red color 34 | COLOR3='\33[0;33m' 35 | NC='\033[0m' #no color 36 | 37 | if [ "$(id -u)" != "0" ]; then 38 | printf "${RED}ERREUR : SH-FIVEM n'a pas accès root. ⛔️\\n" 1>&2 39 | printf "\\n" 40 | exit 1 41 | fi 42 | 43 | 44 | printf "${COLOR1} \\n" 45 | printf "${COLOR1}©️ Copyright Tous droits réservés.©️ \\n" 46 | printf "${COLOR1}PROD : v2.4.2 \\n" 47 | dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'` 48 | # if [ "$dist" == "Ubuntu" ]; then 49 | # printf "${COLOR1}©️ Votre système d'exploitation est pris en charge par SH-FIVEM.©️ \\n" 50 | # else 51 | # printf "${COLOR2}💻 Malheureusement votre système d'exploitation n'est pas pris en charge par SH-FIVEM 💻\\n" 52 | # exit 53 | # fi 54 | printf "${COLOR2}💻 Systèmes pris en charge : $supported 💻\\n" 55 | printf "${NC}\\n" 56 | sleep 6 57 | ############################################################################# 58 | 59 | # Prérequis installation Five M 60 | apt update -y 61 | apt upgrade -y 62 | apt install sudo xz-utils screen jq zip -y 63 | 64 | #Installation de LATEST 65 | echo 66 | printf "${YELLOW} LAST NEW Artifacts : Souhaitez-vous instalaltion du serveur Five M avec la version de LATEST ❓ [o/N]\\n" 67 | read reponse 68 | if [[ "$reponse" == "o" ]] 69 | then 70 | printf "${CYAN} Démarrage de l'instalaltion de version de LATEST pour serveur Five M !" 71 | cd /home/ 72 | mkdir -p fivem 73 | cd /home/fivem 74 | RELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) 75 | CHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server) 76 | 77 | if [[ "${FIVEM_VERSION}" == "latest" ]] || [[ -z ${FIVEM_VERSION} ]]; then 78 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 79 | else 80 | VERSION_LINK=$(echo -e "${RELEASE_PAGE}" | grep -Eo '".*/*.tar.xz"' | grep -Eo '".*"' | sed 's/\"//g' | sed 's/\.\///1' | grep ${CFX_VERSION}) 81 | if [[ "${VERSION_LINK}" == "" ]]; then 82 | echo -e "defaulting to latest as the version requested was invalid." 83 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 84 | else 85 | DOWNLOAD_LINK=$(echo https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${VERSION_LINK}) 86 | fi 87 | fi 88 | 89 | 90 | 91 | curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/} 92 | 93 | tar xvfJ fx.tar.xz 94 | # Suppression du cache automatique 95 | # sed -i '1irm -r cache' run.sh 96 | rm fx.tar.xz 97 | fi 98 | sleep 2 99 | 100 | 101 | 102 | 103 | # Installation MARIADB 104 | echo 105 | printf "${CYAN} Démarrage de l'instalaltion de MariaDB pour serveur FiveM !" 106 | speed 4 107 | sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg 108 | echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list 109 | apt update -y 110 | apt install php8.1 -y 111 | apt -y install php8.1-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip} apache2 mariadb-server tar unzip git -y 112 | php -v 113 | curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash 114 | apt update -y 115 | 116 | printf "${CYAN} Ready MYSQL !" 117 | 118 | 119 | sleep 2 120 | 121 | echo -n -e "${GREEN}Quel est le nom de votre base de données ❓ ${YELLOW}(sh_base)${reset}: " 122 | read -r DBNAME 123 | 124 | if [[ "$DBNAME" == "" ]]; then 125 | DBNAME="sh_base" 126 | fi 127 | 128 | sleep 2 129 | echo -n -e "${GREEN}Quel est l'utilisateur de votre base de données ❓ ${YELLOW}(sh-fivem)${reset}: " 130 | read -r DBUSER 131 | 132 | if [[ "$DBUSER" == "" ]]; then 133 | DBUSER="sh-fivem" 134 | fi 135 | 136 | sleep 2 137 | echo -n -e "${GREEN}Quel est le mot de passe de votre base de données ❓ ${reset}: " 138 | read -s -r DBPASS 139 | 140 | while true; do 141 | 142 | if [[ "$DBPASS" == "" ]]; then 143 | echo -e "${red}Le mot de passe doit être obligatoire !" 144 | echo -n -e "${GREEN}Quel est le mot de passe de votre base de données ❓ ${reset}: " 145 | read -s -r DBPASS 146 | else 147 | echo -e "${GREEN}Le mot de passe est correct !${reset}" 148 | break 149 | fi 150 | done 151 | 152 | #Installation PHPMYADMIN 153 | echo 154 | printf "${YELLOW} Souhaitez-vous crée une installation automatique de PHPMYADMIN ❓ [o/N]\\n" 155 | read reponse 156 | if [[ "$reponse" == "o" ]] 157 | then 158 | printf "${CYAN} Démarrage de l'instalaltion de phpMyAdmin pour serveur Five M !" 159 | PHPMYADMIN_VER=$(curl -s "https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest" | grep -m1 '^[[:blank:]]*"name":' | cut -d \" -f 4) 160 | mkdir -p /usr/share/phpmyadmin/ || exit 161 | wget https://files.phpmyadmin.net/phpMyAdmin/"$PHPMYADMIN_VER"/phpMyAdmin-"$PHPMYADMIN_VER"-all-languages.tar.gz -O /usr/share/phpmyadmin/phpMyAdmin-"$PHPMYADMIN_VER"-all-languages.tar.gz 162 | tar xzf /usr/share/phpmyadmin/phpMyAdmin-"$PHPMYADMIN_VER"-all-languages.tar.gz --strip-components=1 --directory /usr/share/phpmyadmin 163 | rm -f /usr/share/phpmyadmin/phpMyAdmin-"$PHPMYADMIN_VER"-all-languages.tar.gz 164 | # Create phpMyAdmin TempDir 165 | mkdir -p /usr/share/phpmyadmin/tmp || exit 166 | chown www-data:www-data /usr/share/phpmyadmin/tmp 167 | chmod 700 /usr/share/phpmyadmin/tmp 168 | randomBlowfishSecret=$(openssl rand -base64 22) 169 | sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php >/usr/share/phpmyadmin/config.inc.php 170 | ln -s /usr/share/phpmyadmin /var/www/phpmyadmin 171 | if [[ "$webserver" =~ (apache2) ]]; then 172 | wget -O /etc/apache2/sites-available/phpmyadmin.conf https://raw.githubusercontent.com/MaximeMichaud/Azuriom-install/master/conf/apache2/phpmyadmin.conf 173 | a2ensite phpmyadmin 174 | systemctl restart apache2 ## By MaximeMichaud | par manque de temps pour cette version j'ai pris de ce github le code de phpmyadmin 175 | 176 | echo -e "Configuration de la utilisateur" 177 | echo "Mettre le mot de passe root de MySQL" 178 | sleep 2 179 | mysql -e "CREATE USER '${DBUSER}'@'localhost' IDENTIFIED BY '${DBPASS}';" 180 | mysql -e "CREATE DATABASE ${DBNAME};" 181 | mysql -p -e "GRANT ALL PRIVILEGES ON * . * TO '${DBUSER}'@'localhost';" 182 | mysql -e "FLUSH PRIVILEGES;" 183 | 184 | 185 | sleep 3 186 | 187 | mkdir /etc/sh-fivem/ 188 | echo "SUCCES 202" > /etc/sh-fivem/sh-install 189 | 190 | printf "${COLOR3} L'installation est terminée ! \\n" 191 | printf "${COLOR3} Mon discord : https://discord.gg/Bx5UUV54mu \\n" 192 | printf "${COLOR3} Github de Clahsplayer sur SH-FIVEM: https://github.com/Clashplayer-PROTECT/sh-fivem \\n" 193 | echo -en '\n' 194 | sleep 3 195 | printf "${COLOR1} TOPO du MySQL \\n" 196 | printf "${COLOR1} Lien du phpMyAdmin : http://$(hostname -I)/phpmyadmin/ \\n" 197 | printf "${COLOR1} Nom d'utilisateur de la base de données MySQL: ${DBUSER}\\n" 198 | printf "${COLOR1} Mot de passe de connexion base de données MySQL: ${DBPASS} \\n" 199 | echo -en '\n' 200 | sleep 3 201 | printf "${COLOR2}💻 TOPO sur créaction de votre seveur ! \\n" 202 | printf "${COLOR2}💻 Chemin du dossier : /home/fivem \\n" 203 | printf "${COLOR2}💻 Ne surtout pas supprime run.sh et alpine\\n" 204 | printf "${COLOR2}💻 Ligne FiveM MySQL : \\n" 205 | } 206 | 207 | function UpdateArtefact () { 208 | cd /home/fivem/ 209 | rm -rf alpine/ 210 | RELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) 211 | CHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server) 212 | 213 | if [[ "${FIVEM_VERSION}" == "latest" ]] || [[ -z ${FIVEM_VERSION} ]]; then 214 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 215 | else 216 | VERSION_LINK=$(echo -e "${RELEASE_PAGE}" | grep -Eo '".*/*.tar.xz"' | grep -Eo '".*"' | sed 's/\"//g' | sed 's/\.\///1' | grep ${CFX_VERSION}) 217 | if [[ "${VERSION_LINK}" == "" ]]; then 218 | echo -e "defaulting to latest as the version requested was invalid." 219 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 220 | else 221 | DOWNLOAD_LINK=$(echo https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${VERSION_LINK}) 222 | fi 223 | fi 224 | 225 | 226 | 227 | curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/} 228 | 229 | tar xvfJ fx.tar.xz 230 | # Suppression du cache automatique 231 | # sed -i '1irm -r cache' run.sh 232 | rm fx.tar.xz 233 | } 234 | 235 | function OpenMENU() { 236 | printf "${COLOR3} Bienvenue sur le contrôleur SH-FIVEM ! \\n" 237 | printf "${COLOR2} Que voulez-vous faire ? \\n" 238 | echo " 1) Update votre artefact" 239 | echo " 2) Création d'un nouvel utilisateur PhpMyAdmin - Pas encore disponible" 240 | echo " 3) Quitter" 241 | printf "${NC} \\n" 242 | 243 | until [[ ${MENU_OPTION} =~ ^[1-3]$ ]]; do 244 | read -rp "Sélectionnez une option [1-3]: " MENU_OPTION 245 | done 246 | case "${MENU_OPTION}" in 247 | 1) 248 | UpdateArtefact 249 | ;; 250 | 2) 251 | newPHPMYADMIN 252 | ;; 253 | 3) 254 | exit 0 255 | ;; 256 | esac 257 | } 258 | 259 | 260 | 261 | if [[ -e /etc/sh-fivem/sh-install ]]; then 262 | source /etc/sh-fivem/sh-install 263 | OpenMENU 264 | else 265 | installFIVEM 266 | fi 267 | -------------------------------------------------------------------------------- /sh-fivem-new.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script Auto Install Five M [DEV] 3 | #===================================================================================== 4 | # Author: Clashplayer#2134 5 | #===================================================================================== 6 | #===================================================================================== 7 | # Root Force 8 | # By Clashplayer#2134 9 | 10 | #Supported systems: 11 | supported="Debian 11" 12 | COLOR1='\033[0;32m' #green color 13 | COLOR2='\033[0;31m' #red color 14 | COLOR3='\33[0;33m' 15 | COLOR4='\033[1;35m' 16 | NC='\033[0m' #no color 17 | 18 | 19 | function installFIVEM() { 20 | cat << "EOF" 21 | /$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ 22 | /$$__ $$| $$ | $$ | $$_____/|_ $$_/| $$ | $$| $$_____/| $$$ /$$$ | $$ | $$ /$$__ $$ 23 | | $$ \__/| $$ | $$ | $$ | $$ | $$ | $$| $$ | $$$$ /$$$$ | $$ | $$|__/ \ $$ 24 | | $$$$$$ | $$$$$$$$ /$$$$$$| $$$$$ | $$ | $$ / $$/| $$$$$ | $$ $$/$$ $$ /$$$$$$| $$ / $$/ /$$$$$/ 25 | \____ $$| $$__ $$|______/| $$__/ | $$ \ $$ $$/ | $$__/ | $$ $$$| $$|______/ \ $$ $$/ |___ $$ 26 | /$$ \ $$| $$ | $$ | $$ | $$ \ $$$/ | $$ | $$\ $ | $$ \ $$$/ /$$ \ $$ 27 | | $$$$$$/| $$ | $$ | $$ /$$$$$$ \ $/ | $$$$$$$$| $$ \/ | $$ \ $/ | $$$$$$/ 28 | \______/ |__/ |__/ |__/ |______/ \_/ |________/|__/ |__/ \_/ \______/ 29 | 30 | EOF 31 | #Supported systems: 32 | supported="Debian 11" 33 | COLOR1='\033[0;32m' #green color 34 | COLOR2='\033[0;31m' #red color 35 | COLOR3='\33[0;33m' 36 | NC='\033[0m' #no color 37 | 38 | if [ "$(id -u)" != "0" ]; then 39 | printf "${RED}ERREUR : SH-FIVEM n'a pas accès root. ⛔️\\n" 1>&2 40 | printf "\\n" 41 | exit 1 42 | fi 43 | 44 | 45 | printf "${COLOR1} \\n" 46 | printf "${COLOR1}©️ Copyright Tous droits réservés.©️ \\n" 47 | printf "${COLOR1}PROD : v2.4.2 \\n" 48 | dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'` 49 | # if [ "$dist" == "Ubuntu" ]; then 50 | # printf "${COLOR1}©️ Votre système d'exploitation est pris en charge par SH-FIVEM.©️ \\n" 51 | # else 52 | # printf "${COLOR2}💻 Malheureusement votre système d'exploitation n'est pas pris en charge par SH-FIVEM 💻\\n" 53 | # exit 54 | # fi 55 | printf "${COLOR2}💻 Systèmes pris en charge : $supported 💻\\n" 56 | printf "${NC}\\n" 57 | sleep 6 58 | ############################################################################# 59 | 60 | # Prérequis installation Five M 61 | apt update -y 62 | apt upgrade -y 63 | apt install sudo xz-utils screen jq zip curl -y 64 | chmod 777 sh-fivem.sh 65 | 66 | #Installation de LATEST 67 | echo 68 | printf "${YELLOW} LAST NEW Artifacts : Souhaitez-vous instalaltion du serveur Five M avec la version de LATEST ❓ [o/N]\\n" 69 | read reponse 70 | if [[ "$reponse" == "o" ]] 71 | then 72 | printf "${CYAN} Démarrage de l'instalaltion de version de LATEST pour serveur Five M !" 73 | cd /home/ 74 | mkdir -p fivem 75 | cd /home/fivem 76 | # Récup grâce pterodactyl eggs 77 | RELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) 78 | CHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server) 79 | 80 | if [[ "${FIVEM_VERSION}" == "latest" ]] || [[ -z ${FIVEM_VERSION} ]]; then 81 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 82 | else 83 | VERSION_LINK=$(echo -e "${RELEASE_PAGE}" | grep -Eo '".*/*.tar.xz"' | grep -Eo '".*"' | sed 's/\"//g' | sed 's/\.\///1' | grep ${CFX_VERSION}) 84 | if [[ "${VERSION_LINK}" == "" ]]; then 85 | echo -e "defaulting to latest as the version requested was invalid." 86 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 87 | else 88 | DOWNLOAD_LINK=$(echo https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${VERSION_LINK}) 89 | fi 90 | fi 91 | 92 | 93 | 94 | curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/} 95 | 96 | tar xvfJ fx.tar.xz 97 | # Suppression du cache automatique 98 | # sed -i '1irm -r cache' run.sh 99 | rm fx.tar.xz 100 | fi 101 | sleep 2 102 | 103 | 104 | 105 | 106 | # Installation MARIADB 107 | echo 108 | printf "${CYAN} Démarrage de l'instalaltion de MariaDB pour serveur FiveM !" 109 | apt install lsb-release apt-transport-https ca-certificates -y 110 | sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg 111 | echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list 112 | apt update -y 113 | apt install php8.1 -y 114 | apt -y install php8.1-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip} apache2 mariadb-server tar unzip git -y 115 | php -v 116 | curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash 117 | apt update -y 118 | 119 | printf "${CYAN} Ready MYSQL !" 120 | 121 | 122 | sleep 2 123 | 124 | echo -n -e "${GREEN}Quel est le nom de votre base de données ❓ ${YELLOW}(sh_base)${reset}: " 125 | read -r DBNAME 126 | 127 | if [[ "$DBNAME" == "" ]]; then 128 | DBNAME="sh_base" 129 | fi 130 | 131 | sleep 2 132 | echo -n -e "${GREEN}Quel est l'utilisateur de votre base de données ❓ ${YELLOW}(sh-fivem)${reset}: " 133 | read -r DBUSER 134 | 135 | if [[ "$DBUSER" == "" ]]; then 136 | DBUSER="sh-fivem" 137 | fi 138 | 139 | sleep 2 140 | echo -n -e "${GREEN}Quel est le mot de passe de votre base de données ❓ ${reset}: " 141 | read -s -r DBPASS 142 | 143 | while true; do 144 | 145 | if [[ "$DBPASS" == "" ]]; then 146 | echo -e "${red}Le mot de passe doit être obligatoire !" 147 | echo -n -e "${GREEN}Quel est le mot de passe de votre base de données ❓ ${reset}: " 148 | read -s -r DBPASS 149 | else 150 | echo -e "${GREEN}Le mot de passe est correct !${reset}" 151 | break 152 | fi 153 | done 154 | 155 | 156 | #Installation PHPMYADMIN 157 | echo 158 | printf "${YELLOW} Souhaitez-vous crée une installation automatique de PHPMYADMIN ❓ [o/N]\\n" 159 | read reponse 160 | if [[ "$reponse" == "o" ]] 161 | then 162 | printf "${CYAN} Démarrage de l'instalaltion de phpMyAdmin pour serveur Five M !" 163 | wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip 164 | mkdir -p /usr/share/phpmyadmin/ || exit 165 | wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip -O /usr/share/phpmyadmin/phpMyAdmin-5.2.1-all-languages.tar.gz 166 | cd /usr/share/phpmyadmin 167 | unzip /usr/share/phpmyadmin/phpMyAdmin-5.2.1-all-languages.tar.gz 168 | rm -f /usr/share/phpmyadmin/phpMyAdmin-5.2.1-all-languages.tar.gz 169 | # Create phpMyAdmin TempDir 170 | mkdir -p /usr/share/phpmyadmin/tmp || exit 171 | chown www-data:www-data /usr/share/phpmyadmin/tmp 172 | chmod 700 /usr/share/phpmyadmin/tmp 173 | randomBlowfishSecret=$(openssl rand -base64 22) 174 | sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /usr/share/phpmyadmin/config.sample.inc.php >/usr/share/phpmyadmin/config.inc.php 175 | ln -s /usr/share/phpmyadmin /var/www/phpmyadmin 176 | wget -O /etc/apache2/sites-available/phpmyadmin.conf https://raw.githubusercontent.com/MaximeMichaud/Azuriom-install/master/conf/apache2/phpmyadmin.conf 177 | a2ensite phpmyadmin 178 | systemctl restart apache2 ## By MaximeMichaud | par manque de temps pour cette version j'ai pris de ce github le code de phpmyadmin 179 | 180 | fi 181 | 182 | 183 | 184 | echo -e "Configuration de la utilisateur" 185 | echo "Mettre le mot de passe root de MySQL" 186 | sleep 2 187 | mysql -e "CREATE USER '${DBUSER}'@'localhost' IDENTIFIED BY '${DBPASS}';" 188 | mysql -e "CREATE DATABASE ${DBNAME};" 189 | mysql -p -e "GRANT ALL PRIVILEGES ON * . * TO '${DBUSER}'@'localhost';" 190 | mysql -e "FLUSH PRIVILEGES;" 191 | 192 | 193 | sleep 3 194 | 195 | mkdir /etc/sh-fivem/ 196 | echo "SUCCES 202" > /etc/sh-fivem/sh-install 197 | 198 | printf "${COLOR3} L'installation est terminée ! \\n" 199 | printf "${COLOR3} Mon discord : https://discord.gg/Bx5UUV54mu \\n" 200 | printf "${COLOR3} Github de Clahsplayer sur SH-FIVEM: https://github.com/Clashplayer-PROTECT/sh-fivem \\n" 201 | echo -en '\n' 202 | sleep 3 203 | printf "${COLOR1} TOPO du MySQL \\n" 204 | printf "${COLOR1} Lien du phpMyAdmin : http://$(hostname -I)/phpmyadmin/ \\n" 205 | printf "${COLOR1} Nom d'utilisateur de la base de données MySQL: ${DBUSER}\\n" 206 | printf "${COLOR1} Mot de passe de connexion base de données MySQL: ${DBPASS} \\n" 207 | echo -en '\n' 208 | sleep 3 209 | printf "${COLOR2}💻 TOPO sur créaction de votre seveur ! \\n" 210 | printf "${COLOR2}💻 Chemin du dossier : /home/fivem \\n" 211 | printf "${COLOR2}💻 Ne surtout pas supprime run.sh et alpine\\n" 212 | printf "${COLOR2}💻 Besoin d'update votre Artefact : ./sh-fivem.sh\\n" 213 | printf "${NC}\\n" 214 | 215 | } 216 | 217 | 218 | function UpdateArtefact () { 219 | printf "${YELLOW} LAST NEW Artifacts : Téléchargement de la dernière version LATEST \\n" 220 | printf "${YELLOW} Attention votre serveur doit être éteint, si ce n'est pas le cas : CTRL + C \\n" 221 | pause 20 222 | cd /home/fivem/ 223 | rm -rf alpine/ 224 | RELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) 225 | CHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server) 226 | 227 | if [[ "${FIVEM_VERSION}" == "latest" ]] || [[ -z ${FIVEM_VERSION} ]]; then 228 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 229 | else 230 | VERSION_LINK=$(echo -e "${RELEASE_PAGE}" | grep -Eo '".*/*.tar.xz"' | grep -Eo '".*"' | sed 's/\"//g' | sed 's/\.\///1' | grep ${CFX_VERSION}) 231 | if [[ "${VERSION_LINK}" == "" ]]; then 232 | echo -e "defaulting to latest as the version requested was invalid." 233 | DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download') 234 | else 235 | DOWNLOAD_LINK=$(echo https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${VERSION_LINK}) 236 | 237 | fi 238 | fi 239 | 240 | 241 | 242 | curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/} 243 | 244 | tar xvfJ fx.tar.xz 245 | # Suppression du cache automatique 246 | # sed -i '1irm -r cache' run.sh 247 | rm fx.tar.xz 248 | printf "${NC}\\n" 249 | printf "${COLOR3} Fin de la mise à jour, votre serveur est mis à niveau ! \\n" 250 | 251 | 252 | } 253 | 254 | function OpenMENU() { 255 | printf "${COLOR3} Bienvenue sur le contrôleur SH-FIVEM ! \\n" 256 | printf "${COLOR2} Que voulez-vous faire ? \\n" 257 | echo " 1) Update votre artefact" 258 | #echo " 2) Création d'un nouvel utilisateur PhpMyAdmin - Pas encore disponible" 259 | echo " 2) Quitter" 260 | printf "${NC} \\n" 261 | 262 | until [[ ${MENU_OPTION} =~ ^[1-2]$ ]]; do 263 | read -rp "Sélectionnez une option [1-3]: " MENU_OPTION 264 | done 265 | case "${MENU_OPTION}" in 266 | 1) 267 | UpdateArtefact 268 | ;; 269 | 45) 270 | newPHPMYADMIN 271 | ;; 272 | 2) 273 | exit 0 274 | ;; 275 | esac 276 | } 277 | 278 | 279 | 280 | if [[ -e /etc/sh-fivem/sh-install ]]; then 281 | source /etc/sh-fivem/sh-install 282 | OpenMENU 283 | else 284 | installFIVEM 285 | fi 286 | --------------------------------------------------------------------------------