Add installer.sh

This commit is contained in:
b.waal 2024-06-09 03:11:34 +02:00
parent 19f2068e12
commit 01cc74493a

115
installer.sh Normal file
View File

@ -0,0 +1,115 @@
#!/bin/bash
##---------------##
# Static Vars #
##---------------##
OUTPUT='/dev/null'
APTMODE="debconf-apt-progress -- apt"
PKGM="$APTMODE"
PKGUD="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y"
PKRM="$PKGM remove --purge -y"
PKARM="$PKGM autoremove -y"
REPO=LanCache
BRANCH=main
GIT=https://git.ictcorpnet.com/b.waal/$REPO/raw
##---------------##
# Pre-Updater #
##---------------##
ping -c 1 192.168.1.102 > /dev/null && HOSTUP=yes || HOSTUP=no
if [[ $HOSTUP == yes ]]; then
echo > /dev/tcp/192.168.1.102/80 && echo 'Acquire::http::Proxy "http://192.168.1.102:80";'> /etc/apt/apt.conf.d/01prox
fi
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/01Recommends
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/01Suggests
if [ -f /etc/apt/apt.conf.d/00CDMountPoint ]; then
rm /etc/apt/apt.conf.d/00CDMountPoint
fi
if [ -f /etc/apt/apt.conf.d/00trustcdrom ]; then
rm /etc/apt/apt.conf.d/00trustcdrom
fi
##---------------##
# Dependencies #
##---------------##
#$PKGI curl wget whiptail sudo
apt update
apt upgrade -y
#Docker Requirements
apt install openssh-server curl wget nload htop nano gnupg ca-certificates -y
#Steam Prefill Requirements
apt install jq unzip -y
##------------------##
# Docker Compose #
##------------------##
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt-get install docker-ce docker-ce-cli docker-compose-plugin -y
systemctl enable --now docker
##-------------##
# Pre-Config #
##-------------##
mkdir -p /opt/lancache
mkdir -p /opt/lancache/tools/SteamPrefill
##-------------##
# Installer #
##-------------##
wget $GIT/$BRANCH/config/lancache/default.env -O /opt/lancache/.env
wget $GIT/$BRANCH/config/lancache/highspeed.env -O /opt/lancache/HS.env
wget $GIT/$BRANCH/config/lancache/docker.yml -O /opt/lancache/docker-compose.yml
##----------------##
# Steam Prefill #
##----------------##
#/opt/lancache/tools/SteamPrefill/SteamPrefill prefill --recent --os windows --no-ansi
#/opt/lancache/tools/SteamPrefill/SteamPrefill prefill --os windows --no-ansi
cd /opt/lancache/tools/SteamPrefill
curl -o /opt/lancache/tools/SteamPrefill/update.sh --location "https://raw.githubusercontent.com/tpill90/steam-lancache-prefill/master/scripts/update.sh"
chmod +x /opt/lancache/tools/SteamPrefill/update.sh
bash /opt/lancache/tools/SteamPrefill/update.sh
chmod +x /opt/lancache/tools/SteamPrefill/SteamPrefill
wget $GIT/$BRANCH/config/tools/prefill/steam/recent.timer -O /etc/systemd/system/steamprefill-recent.timer
wget $GIT/$BRANCH/config/tools/prefill/steam/selected.timer -O /etc/systemd/system/steamprefill-selected.timer
wget $GIT/$BRANCH/config/tools/prefill/steam/recent.service -O /etc/systemd/system/steamprefill-recent.service
wget $GIT/$BRANCH/config/tools/prefill/steam/selected.service -O /etc/systemd/system/steamprefill-selected.service
systemctl daemon-reload
systemctl enable --now steamprefill-selected.timer
systemctl enable --now steamprefill-recent.timer
systemctl enable steamprefill-selected.service
systemctl enable steamprefill-recent.service
##---------------##
# Cleaning up #
##---------------##
apt remove --purge vim* mailcap* man-db* manpages* laptop-detect* publicsuffix* xkb-data* python*
apt autoremove