-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReziInstall.sh
More file actions
97 lines (83 loc) · 3.55 KB
/
ReziInstall.sh
File metadata and controls
97 lines (83 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
GREEN='\033[1;32m'
BLUE='\033[1;34m'
YELLOW='\033[1;33m'
NC='\033[0m'
update_script() {
echo -e "${YELLOW}Aktualisiere das Skript...${NC}"
repo="SirRezi/Rezi_FiveM_Install"
script="ReziInstall.sh"
curl -sLO "https://raw.githubusercontent.com/$repo/main/$script"
chmod +x $script
echo -e "${YELLOW}Update erfolgreich durchgeführt.${NC}"
}
check_for_update() {
clear || printf "\033c"
echo -e "${BLUE}=====================================================${NC}"
echo -e "${BLUE}============= FiveM mit TxAdmin Installer ===========${NC}"
echo -e "${BLUE}=====================================================${NC}"
echo -e "${GREEN}Dieses Skript wurde von SirRezi erstellt.${NC}"
echo
echo -e "${YELLOW}Überprüfe auf Updates...${NC}"
repo="SirRezi/Rezi_FiveM_Install"
script="ReziInstall.sh"
local_version=$(<"$script" grep -m 1 'Version: ' | awk '{print $2}')
latest_version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [ "$local_version" != "$latest_version" ]; then
echo -e "${YELLOW}Eine neue Version ist verfügbar.${NC}"
read -p "Möchtest du das Update herunterladen? (ja/nein): " update_choice
if [[ "$update_choice" == "ja" ]]; then
update_script
else
echo -e "${YELLOW}Update abgebrochen.${NC}"
fi
else
echo -e "${YELLOW}Das Skript ist auf dem neuesten Stand.${NC}"
sleep 5
clear || printf "\033c"
fi
}
run_installer() {
clear || printf "\033c"
echo -e "${BLUE}=====================================================${NC}"
echo -e "${BLUE}============= FiveM mit TxAdmin Installer ===========${NC}"
echo -e "${BLUE}=====================================================${NC}"
echo -e "${GREEN}Dieses Skript wurde von SirRezi erstellt.${NC}"
echo
read -p "Möchtest du die Installation von FiveM mit TxAdmin starten? (ja/nein): " choice
if [[ "$choice" != "ja" ]]; then
echo -e "${GREEN}Installation abgebrochen.${NC}"
exit 0
fi
echo -e "${YELLOW}Aktualisiere Paketliste und installiere benötigte Pakete...${NC}"
apt update
apt upgrade -y
apt-get install -y xz-utils git screen
echo -e "${YELLOW}Erstelle FiveM-Server-Verzeichnis und lade FiveM-Server herunter...${NC}"
mkdir -p /home/FiveM/server
cd /home/FiveM/server
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/7257-030778a167242f79e0f59cd8d9c04b970e3b75c2/fx.tar.xz
tar xf fx.tar.xz
rm fx.tar.xz
echo -e "${YELLOW}Erstelle FiveM-Server-Daten-Verzeichnis und konfiguriere...${NC}"
mkdir -p /home/FiveM/server-data
cd /home/FiveM/server-data
git clone https://github.com/citizenfx/cfx-server-data.git /home/FiveM/server-data
echo -e "${BLUE}=====================================================${NC}"
echo -e "${GREEN}============ Installation ist fertig ================${NC}"
echo -e "${BLUE}=====================================================${NC}"
echo
sleep 5
clear || printf "\033c"
}
clear || printf "\033c"
local_version=$(<"ReziInstall.sh" grep -m 1 'Version: ' | awk '{print $2}')
latest_version=$(curl -s "https://api.github.com/repos/SirRezi/Rezi_FiveM_Install/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [ "$local_version" != "$latest_version" ]; then
check_for_update
else
echo -e "${YELLOW}Das Skript ist auf dem neuesten Stand.${NC}"
sleep 5
clear || printf "\033c"
fi
run_installer