-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
25 lines (18 loc) · 1.03 KB
/
start.sh
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
#!/bin/bash
echo "Server Starting..."
RELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/)
CHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server)
echo -e "Checking for latest version of FiveM..."
if [[ "${AUTO_UPDATE}" == "1" ]]; then
DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download')
rm -rf /home/container/alpine
echo -e "Downloading latest version of FiveM..."
curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}
echo "Extracting fivem files"
tar -xvf ${DOWNLOAD_LINK##*/}
rm -rf ${DOWNLOAD_LINK##*/} run.sh
else
echo -e "Using local version of FiveM... not downloading latest."
fi
echo -e "Starting FiveM Server..."
$(pwd)/alpine/opt/cfx-server/ld-musl-x86_64.so.1 --library-path "$(pwd)/alpine/usr/lib/v8/:$(pwd)/alpine/lib/:$(pwd)/alpine/usr/lib/" -- $(pwd)/alpine/opt/cfx-server/FXServer +set citizen_dir $(pwd)/alpine/opt/cfx-server/citizen/ +set serverProfile default +set txAdminPort ${TXADMIN_PORT}