Skip to content

Installation

7thCore edited this page Nov 13, 2024 · 4 revisions

Installation

You have 3 ways to install the script:

After that continue with user login and configuration


Installation by repository

By installing the repository you will also be able to update the script using the package manager when a new update is available.

Arch based distro

Edit /etc/pacman.confand add the following line to the bottom of the file:

Include = /etc/pacman.d/seventhcore-scripts-repo

Then create a new file at /etc/pacman.d/seventhcore-scripts-repo and add the following content:

[seventhcore-scripts-repo]
SigLevel = Optional TrustAll
Server = https://raw.githubusercontent.com/7thCore/pkg-repo/pkg-arch

Arch users have to install steamcmd from the aur before attempting to install the package.

You can now install the script by running pacman -Sy hlnsrv-script

Debian based distro

First you need to download and add the repository public key to your keyring. Now because apt-key is deprecated we will be using a diffrent command to get the key:

wget --quiet -O - https://raw.githubusercontent.com/7thCore/pkg-repo/pkg-debian/seventhcore-scripts-repo.key | gpg --dearmor | sudo tee "/usr/share/keyrings/seventhcore-scripts-repo.gpg" >/dev/null

Now create a new file at /etc/apt/sources.list.d/seventhcore-scripts-repo.list and add the following content:

deb [arch=amd64 signed-by=/usr/share/keyrings/seventhcore-scripts-repo.gpg] https://raw.githubusercontent.com/7thCore/pkg-repo/pkg-debian stable main

You can now install the script by running apt update and after that apt install hlnsrv-script


Installation by package

Download the package to your server.

Arch based distro:

Arch users have to install steamcmd from the aur before attempting to install the package.

pacman -U /path/to/hlnsrv-script-1.0-1-x86_64.pkg.tar.zst

Debian based distro:

apt install /path/to/hlnsrv-server_1.0-1_amd64.deb

All the required packages are listed as dependacies in the script package and they will be installed automaticaly


Manual installation

Log in to your server with ssh and execute:

git clone https://github.com/7thCore/hlnsrv-script

Copy the hlnsrv script to /usr/bin

cp ./hlnsrv-script.bash /usr/bin/hlnsrv-script

User and folder structure creation

Create the hlnsrv user

useradd --system -g hlnsrv -d /srv/hlnsrv/ -s /bin/bash hlnsrv

Create the folder structure for the server:

mkdir -p /srv/hlnsrv/{server,config,updates,backups,logs,tmpfs}
mkdir -p /srv/hlnsrv/.config/systemd/user

Service and timer installation

Copy all the .service and .timer files to the user directory

cp ./*.service /srv/hlnsrv/.config/systemd/user/
cp ./*.timer /srv/hlnsrv/.config/systemd/user/

Bash profile installation and permissions configuration

Copy the bash profile to the hlnsrv directory

cp ./bash_profile /srv/hlnsrv/.bash_profile

Give file permissions to the user

chown -R hlnsrv:hlnsrv /srv/hlnsrv

Configure user service

Start the user service and enable linger

loginctl enable-linger hlnsrv
systemctl start user@$(id -u hlnsrv).service

User login and script configuration

sudo -i -u hlnsrv
hlnsrv-script config_script

Clone this wiki locally