This commit is contained in:
iamBadgers
2024-08-10 22:16:02 -07:00
15 changed files with 157 additions and 25 deletions

View File

@@ -2,11 +2,30 @@
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
echo ""
echo "---"
echo "Creating user rushstats"
echo "---"
if [id rushstats >/dev/null 2>&1]; then
echo "rushstats user already exists, skipping."
else
useradd -s /sbin/nologin rushstats
echo "User rushstats created with /sbin/nologin"
fi
echo ""
echo "---"
echo "Moving the distributable folder into /srv/gamestats"
echo "---"
cp -rf "$parent_path"/dist /srv/gamestats
if [ -d /srv/gamestats ]; then
echo "/srv/gamestats already exists; removing"
rm -r /srv/rushstats
fi
mkdir /srv/gamestats
cp -r "$parent_path"/dist/* /srv/gamestats
cp -r "$parent_path"/loader/* /srv/gamestats
chown -R rushstats:rushstats /srv/gamestats
echo ""
echo "---"
@@ -32,14 +51,18 @@ echo "[Install]" >> $SYSTEMD_SERVICE_FILE
echo "WantedBy=multi-user.target" >> $SYSTEMD_SERVICE_FILE
echo "" >> $SYSTEMD_SERVICE_FILE
echo ""
echo "---"
echo "Creating the cron job to refresh the database."
echo "---"
echo "Created new service."
echo cat $SYSTEMD_SERVICE_FILE
echo ""
echo "---"
echo "Reloading daemons and starting service"
echo "---"
systemctl daeomon-reload
systemctl start rushstats.service
systemctl daemon-reload
systemctl enable rushstats.service
systemctl start rushstats.service
echo ""
echo "---"
echo "Creating the cron job to refresh the database."
echo "---"