„scripts/start.sh“ hinzufügen

This commit is contained in:
2020-02-25 14:14:30 +01:00
parent 6f44bf91fa
commit 25d83d906a

27
scripts/start.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
echo "---Checking if UID: ${UID} matches user---"
usermod -u ${UID} ${USER}
echo "---Checking if GID: ${GID} matches user---"
usermod -g ${GID} ${USER}
echo "---Setting umask to ${UMASK}---"
umask ${UMASK}
echo "---Checking for optional scripts---"
if [ -f /opt/scripts/user.sh ]; then
echo "---Found optional script, executing---"
chmod +x /opt/scripts/user.sh
/opt/scripts/user.sh
else
echo "---No optional script found, continuing---"
fi
echo "---Starting...---"
chown -R ${UID}:${GID} /opt/scripts
chown -R ${UID}:${GID} $DATA_DIR/.local
chown -R ${UID}:${GID} /var/lib/mysql
chown -R ${UID}:${GID} /var/run/mysqld
chmod -R 770 $DATA_DIR/".local/share/Arma 3"
chmod -R 770 $DATA_DIR/".local/share/Arma 3 - Other Profiles"
chmod -R 770 /var/lib/mysql
chmod -R 770 /var/run/mysqld
su ${USER} -c "/opt/scripts/start-server.sh"