soios/contestops/configure-machines.sh

23 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -ex
# Disable WiFi.
parallel-ssh -x "-F local.ssh_config" -h hostlist nmcli radio wifi off
# Create hosts file so we don't need DNS.
parallel-scp -x "-F local.ssh_config" -h hostlist ./config-hosts /etc/hosts
# Configure firewall.
parallel-scp -x "-F local.ssh_config" -h hostlist ./config-nftables.conf /etc/nftables.conf
parallel-ssh -x "-F local.ssh_config" -h hostlist systemctl enable nftables.service
# For some unknown reason nft gets stuck the first time it is run.
parallel-ssh -x "-F local.ssh_config" -h hostlist --par 30 systemctl start nftables.service
# Uncomment these lines if machines have 4K displays. This scales display to 2x.
# parallel-scp -x "-F local.ssh_config" -h hostlist ./set-display-scale.py /usr/local/bin/set-display-scale.py
# parallel-ssh -x "-F local.ssh_config" -h hostlist 'DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u contestant)/bus" runuser -u contestant -- python3 /usr/local/bin/set-display-scale.py'
# Configure contest lock screen.
parallel-scp -x "-F local.ssh_config" -h hostlist ./contest-lock.json /etc/contest-lock.json