„scripts/start.sh“ ändern

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

View File

@@ -1,18 +1,22 @@
#!/bin/bash #!/bin/bash
echo "---Checking if UID: ${UID} matches user---" echo "---Ensuring UID: ${UID} matches user---"
usermod -u ${UID} ${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} usermod -g ${GID} ${USER}
echo "---Setting umask to ${UMASK}---" echo "---Setting umask to ${UMASK}---"
umask ${UMASK} umask ${UMASK}
echo "---Checking for optional scripts---" 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 ||:
echo "---Found optional script, executing---" cp -f /opt/scripts/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
chmod +x /opt/scripts/user.sh
/opt/scripts/user.sh 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 else
echo "---No optional script found, continuing---" echo "---No optional script found, continuing---"
fi fi
if [ ! -d /tmp/xdg ]; then if [ ! -d /tmp/xdg ]; then
@@ -24,7 +28,7 @@ sed -i "/ <user>/c\ <user>${USER}</user>" /usr/share/dbus-1/system.conf
echo "---Checking configuration for noVNC---" echo "---Checking configuration for noVNC---"
novnccheck novnccheck
echo "---Starting...---" echo "---Taking ownership of data...---"
rm -R ${DATA_DIR}/.dbus/session-bus/* 2> /dev/null rm -R ${DATA_DIR}/.dbus/session-bus/* 2> /dev/null
if [ ! -d /var/run/dbus ]; then if [ ! -d /var/run/dbus ]; then
mkdir -p /var/run/dbus mkdir -p /var/run/dbus
@@ -41,6 +45,7 @@ chown -R ${UID}:${GID} /opt/gpodder
chown -R ${UID}:${GID} ${DATA_DIR} chown -R ${UID}:${GID} ${DATA_DIR}
chown ${UID}:${GID} /mnt/ chown ${UID}:${GID} /mnt/
echo "---Starting...---"
term_handler() { term_handler() {
kill -SIGTERM "$killpid" kill -SIGTERM "$killpid"
wait "$killpid" -f 2>/dev/null wait "$killpid" -f 2>/dev/null