24 lines
832 B
Bash
24 lines
832 B
Bash
#!/bin/bash
|
|
echo "---Ensuring UID: ${UID} matches user---"
|
|
usermod -u ${UID} ${USER}
|
|
echo "---Ensuring GID: ${GID} matches user---"
|
|
groupmod -g ${GID} ${USER} > /dev/null 2>&1 ||:
|
|
usermod -g ${GID} ${USER}
|
|
echo "---Setting umask to ${UMASK}---"
|
|
umask ${UMASK}
|
|
|
|
echo "---Checking for optional scripts---"
|
|
cp -f /opt/custom/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
|
cp -f /opt/scripts/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
|
|
|
if [ -f /opt/scripts/start-user.sh ]; then
|
|
echo "---Found optional script, executing---"
|
|
chmod -f +x /opt/scripts/start-user.sh.sh ||:
|
|
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
|
|
else
|
|
echo "---No optional script found, continuing---"
|
|
fi
|
|
|
|
echo "---Starting...---"
|
|
chown -R ${UID}:${GID} /opt/scripts
|
|
/opt/scripts/start-server.sh |