Streamlined the entrypoint script.

This commit is contained in:
Ameer Hamza Khan
2025-12-25 20:24:42 +08:00
parent 6122e061a7
commit 17289aeac4
5 changed files with 97 additions and 56 deletions

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Update apt package cache with network check
# Can be called independently or during container initialization
set -e
# Gracefully update package lists if network is available
echo "Checking network connectivity..."
if ping -c 1 -W 5 8.8.8.8 >/dev/null 2>&1 || ping -c 1 -W 5 1.1.1.1 >/dev/null 2>&1; then
echo "Network detected, refreshing package lists..."
if sudo apt update; then
echo "Package lists updated successfully"
else
echo "Warning: apt update failed despite network connectivity"
echo "Falling back to cached package lists"
fi
else
echo "No network connectivity detected, using cached package lists"
fi