28 lines
502 B
Bash
28 lines
502 B
Bash
#!/bin/sh
|
|
|
|
# --- CONFIGURATION ---
|
|
IP=${STATIC_IP:-"192.168.0.116/24"}
|
|
GW=${STATIC_GW:-"192.168.0.1"}
|
|
|
|
echo "--- ClamAV Network Init ---"
|
|
echo "Using IP: $IP"
|
|
|
|
# 1. Generate Network Config (Alpine Syntax)
|
|
cat <<EOF > /etc/network/interfaces
|
|
auto lo
|
|
iface lo inet loopback
|
|
|
|
auto eth0
|
|
iface eth0 inet static
|
|
address $IP
|
|
gateway $GW
|
|
EOF
|
|
|
|
# 2. Wait for Hardware & Start Network
|
|
sleep 5
|
|
ifup eth0
|
|
|
|
# 4. Launch ClamAV (The official entrypoint is /init)
|
|
echo "--- Starting ClamAV ---"
|
|
exec /init "$@"
|