urt

by kbar
22 deployments · 8 still active · last rev. 6 months ago

urt

Compatible with: CentOS 7
						#!/usr/bin/env bash

set -e

mkdir -p /root/.ssh/
curl -o /root/.ssh/authorized_keys https://github.com/bsdlp.keys

yum update -y
yum install -y epel-release
yum install -y docker pwgen jq unzip lvm2
systemctl stop docker
systemctl enable docker

pvcreate -ffy /dev/sdb
vgcreate -ffy docker /dev/sdb
lvcreate --wipesignatures y -n thinpool -y docker -l 95%VG
lvcreate --wipesignatures y -n thinpoolmeta -y docker -l 1%VG
lvconvert -y --zero n -c 512K --thinpool docker/thinpool --poolmetadata docker/thinpoolmeta

cat <<EOF >/etc/lvm/profile/docker-thinpool.profile
activation {
    thin_pool_autoextend_threshold=80
    thin_pool_autoextend_percent=20
}
EOF

lvchange --metadataprofile docker-thinpool docker/thinpool
sed -i "s/OPTIONS.*/OPTIONS='--selinux-enabled --storage-driver=devicemapper --storage-opt=dm.thinpooldev=\/dev\/mapper\/docker-thinpool --storage-opt dm.use_deferred_removal=true'/g" /etc/sysconfig/docker
systemctl start docker
docker pull urbanterror/urbanterror

MAPS_DIR=/my_server/maps
mkdir -p /opt/urt $MAPS_DIR
curl -o /tmp/maps.zip https://objects-us-west-1.dream.io/urt/maps.zip
unzip -d $MAPS_DIR /tmp/maps.zip
rm -f /tmp/maps.zip

curl -o /opt/urt/server.cfg 'https://gist.githubusercontent.com/bsdlp/5e9942ddd79cf759182fa26247c874bd/raw/09277f82b74def37d02e0522e65654f002ac8c1a/urt.cfg'
curl -o /opt/urt/ftw.cfg 'http://ngwgaming.com/ftw.cfg'
curl -o /usr/local/bin/starturt https://gist.githubusercontent.com/bsdlp/30b5aa1113bdae9292318e81014521d7/raw/cc1d0542c44d54e73d72df4042e8f8dc51710385/starturt.sh
chmod +x /usr/local/bin/starturt
curl -o /usr/local/bin/stopurt https://gist.githubusercontent.com/bsdlp/112e2f833cd2076fc86719ebc37d61bb/raw/a58d2002092361711313ab58c7e5e62273990b13/stopurt.sh
chmod +x /usr/local/bin/stopurt