Skip to content

Instantly share code, notes, and snippets.

@egeexyz
Created September 1, 2020 14:43
Show Gist options
  • Save egeexyz/35b55c915f2b01bcb94ac3cd61fecf1f to your computer and use it in GitHub Desktop.
Save egeexyz/35b55c915f2b01bcb94ac3cd61fecf1f to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
GAME=
SSH_PORT=
DEPENDENCIES="steamcmd mono-complete npm default-jdk libcurl3-gnutls:i386 libstdc++6:i386 lib32gcc1 curl git"
dpkg --add-architecture i386
echo steam steam/question select "I AGREE" | sudo debconf-set-selections
echo steam steam/license note '' | sudo debconf-set-selections
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
sed -i "s/#Port 22/Port ${SSH_PORT}/" /etc/ssh/sshd_config
sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config
systemctl enable ufw
ufw default allow outgoing
ufw default deny incoming
ufw allow ${SSH_PORT}
systemctl start ufw
apt-get update
apt-get install -y "${DEPENDENCIES}"
npm install -g log-parsed
npm install -g gsd-cli
touch /etc/systemd/system/${GAME}-logger.service
echo "[Unit]
Description=A service for parsing the systemd journal
After=network.target
[Install]
WantedBy=default.target
[Service]
Type=simple
ExecStart=log-parsed ${GAME}" > /etc/systemd/system/${GAME}-logger.service
su -c "gsd-cli install -n ${GAME}"
su -c "systemctl daemon-reload"
su -c "systemctl enable --now ${GAME}"
su -c "systemctl enable --now ${GAME}-logger"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment