„scripts/start.sh“ ändern

This commit is contained in:
2022-04-15 11:22:26 +02:00
parent 0749d01c05
commit b47dc646c6

View File

@@ -1,16 +1,20 @@
#!/bin/bash
echo "---Checking if UID: ${UID} matches user---"
echo "---Ensuring UID: ${UID} matches user---"
usermod -u ${UID} ${USER}
echo "---Checking if GID: ${GID} matches 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---"
if [ -f /opt/scripts/user.sh ]; then
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 +x /opt/scripts/user.sh
/opt/scripts/user.sh
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
@@ -24,7 +28,7 @@ sed -i "/ <user>/c\ <user>${USER}</user>" /usr/share/dbus-1/system.conf
echo "---Checking configuration for noVNC---"
novnccheck
echo "---Starting...---"
echo "---Taking ownership of data...---"
rm -R ${DATA_DIR}/.dbus/session-bus/* 2> /dev/null
if [ ! -d /var/run/dbus ]; then
mkdir -p /var/run/dbus
@@ -41,6 +45,7 @@ chown -R ${UID}:${GID} /opt/gpodder
chown -R ${UID}:${GID} ${DATA_DIR}
chown ${UID}:${GID} /mnt/
echo "---Starting...---"
term_handler() {
kill -SIGTERM "$killpid"
wait "$killpid" -f 2>/dev/null