Files
redl-gamepanel/bin/fiverp.init
T
Claude Opus 5andClaude Opus 5 c857979a55 FiveRP: the server from the hosting account, not the earlier one
Wrong server was published before. This is the one that runs on the
hosting account the video was made on: FiveRP - two-step registration
(account, then an identity printed onto a passport), login that returns
you to your resident, and a loading screen driven by the game's own
streaming events.

  resources/[local]/fiverp-auth          NUI + scrypt hashes + oxmysql
  resources/[local]/fiverp-characters    identity, character load, spawn
  resources/[local]/fiverp-loadscreen    loading screen
  sql/schema.sql                         accounts, characters
  docs/DESIGN.md                         the design system every screen follows
  docs/screens/                          shot from the live server

Only our own code is in here. cfx-server-data and oxmysql are fetched by
install.sh instead of being vendored, which keeps the repo at 3.7 MB.

install.sh does the whole box in one command: recommended FXServer
build, cfx-server-data, oxmysql, MariaDB with the schema, resources,
server.cfg (mode 600 - it carries the key and the database password),
boot entry, then it waits for the Cfx registration. Tested end to end on
a spare install root: 29 resources scanned, database and schema created,
and it stopped exactly where a wrong licence key should stop it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 23:42:20 +00:00

51 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
### BEGIN INIT INFO
# Provides: fiverp
# Required-Start: $network mariadb
# Default-Start: 2 3 4 5
# Short-Description: FiveRP (FXServer)
### END INIT INFO
NAME=fiverp
DIR=/opt/fivem
LOG=/opt/fivem/logs/server.log
SUPPID=/run/$NAME.sup.pid
CHILDPID=/run/$NAME.child.pid
status() {
if [ -f $CHILDPID ] && kill -0 "$(cat $CHILDPID)" 2>/dev/null; then
echo "$NAME running (pid $(cat $CHILDPID))"; return 0
fi
echo "$NAME not running"; return 3
}
start() {
if status >/dev/null 2>&1; then echo "$NAME already running"; return 0; fi
service mariadb start >/dev/null 2>&1
i=0
while ! mysqladmin ping >/dev/null 2>&1; do
i=$((i+1)); [ $i -gt 30 ] && echo "warning: mariadb did not come up" && break
sleep 1
done
setsid $DIR/bin/run-server.sh $NAME $DIR $LOG >/dev/null 2>&1 < /dev/null &
sleep 2
echo "$NAME started"
}
stop() {
[ -f $SUPPID ] && kill -TERM "$(cat $SUPPID)" 2>/dev/null
[ -f $CHILDPID ] && kill -TERM "$(cat $CHILDPID)" 2>/dev/null
sleep 2
[ -f $CHILDPID ] && kill -9 "$(cat $CHILDPID)" 2>/dev/null
rm -f $SUPPID $CHILDPID
echo "$NAME stopped"
}
case "$1" in
start) start ;;
stop) stop ;;
restart) stop; start ;;
status) status ;;
*) echo "usage: $0 {start|stop|restart|status}"; exit 1 ;;
esac