Create some temp files to indicate that the container has executed the init scripts for the first time

This could be useful for the user scripts to read to know if this is the first time they are running on this container or if the container was just restarted
This commit is contained in:
Josh.5
2023-09-09 20:50:29 +12:00
parent 7513c19bfd
commit 60fa2363eb

View File

@@ -29,6 +29,7 @@ for init_script in /etc/cont-init.d/*.sh ; do
sed -i 's/\r$//' "${init_script:?}" sed -i 's/\r$//' "${init_script:?}"
source "${init_script:?}" source "${init_script:?}"
done done
touch /tmp/.first-run-init-scripts
# Execute any user generated init scripts # Execute any user generated init scripts
mkdir -p ${USER_HOME:?}/init.d mkdir -p ${USER_HOME:?}/init.d
@@ -54,6 +55,7 @@ for user_init_script in ${USER_HOME:?}/init.d/*.sh ; do
fi fi
done done
touch /tmp/.first-run-user-init-scripts
# Start supervisord # Start supervisord
echo echo