mirror of
https://github.com/Monadical-SAS/cubbi.git
synced 2025-12-22 13:19:06 +00:00
refactor: rename driver to image, first pass
This commit is contained in:
31
mcontainer/images/goose/init-status.sh
Normal file
31
mcontainer/images/goose/init-status.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Script to check and display initialization status
|
||||
|
||||
# Only proceed if running as root
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Quick check instead of full logic
|
||||
if ! grep -q "INIT_COMPLETE=true" "/init.status" 2>/dev/null; then
|
||||
# Only follow logs if initialization is incomplete
|
||||
if [ -f "/init.log" ]; then
|
||||
echo "----------------------------------------"
|
||||
tail -f /init.log &
|
||||
tail_pid=$!
|
||||
|
||||
# Check every second if initialization has completed
|
||||
while true; do
|
||||
if grep -q "INIT_COMPLETE=true" "/init.status" 2>/dev/null; then
|
||||
kill $tail_pid 2>/dev/null
|
||||
echo "----------------------------------------"
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
else
|
||||
echo "No initialization logs found."
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu mcuser /bin/bash -il
|
||||
Reference in New Issue
Block a user