33 lines
678 B
Bash
33 lines
678 B
Bash
#!/bin/bash
|
|
|
|
echo "=== Starting Squid SSL container ==="
|
|
|
|
# Create all necessary directories
|
|
mkdir -p /var/cache/squid
|
|
mkdir -p /var/log/squid
|
|
mkdir -p /run/squid
|
|
|
|
# Set basic permissions
|
|
chown -R proxy:proxy /var/cache/squid
|
|
chown -R proxy:proxy /var/log/squid
|
|
chown -R proxy:proxy /run/squid
|
|
chown proxy:proxy /etc/squid/ssl/*
|
|
|
|
# Initialize SSL database
|
|
/usr/local/bin/init-ssl.sh
|
|
|
|
# Initialize cache if needed
|
|
if [ ! -d /var/cache/squid/00 ]; then
|
|
echo "Initializing Squid cache..."
|
|
squid -N -z
|
|
echo "Cache initialized"
|
|
fi
|
|
|
|
# Test Squid configuration
|
|
echo "Testing Squid configuration..."
|
|
squid -k parse
|
|
|
|
# Start Squid
|
|
echo "Starting Squid..."
|
|
exec squid -N -d 1
|