APmanageur Wi-Fi V1.0

This commit is contained in:
yoannmultigaming committed 2026-11-18 00:05:54 +01:00
1 parent 2c5452af0d
commit fffffcf301
3 files changed
+8 -22

No files matched your search

+2 -8
View File
@@ -20,10 +20,9 @@ export AP_WEB_PORT
AP_MAX_CLIENTS="${AP_MAX_CLIENTS:-0}"
export AP_MAX_CLIENTS
AP_MODE="${AP_MODE:-ap}"
AP_BRIDGE_NAME="${AP_BRIDGE_NAME:-br0}"
AP_BRIDGE_ETH="${AP_BRIDGE_ETH:-}"
export AP_MODE AP_BRIDGE_NAME AP_BRIDGE_ETH
export AP_BRIDGE_NAME AP_BRIDGE_ETH
# Détection de la première interface Ethernet candidate si non spécifiée
if [[ -z "$AP_BRIDGE_ETH" ]]; then
@@ -59,7 +58,7 @@ done
[[ -n "$IFACE" ]] && iw dev "$IFACE" info >/dev/null 2>&1 || { log "ERREUR : interface '${IFACE:-?}' absente après 3 min (détectées : ${FOUND[*]:-aucune})"; exit 1; }
export AP_INTERFACE="$IFACE"
log "Interface Wi-Fi sélectionnée : $IFACE"
log "Mode réseau : $AP_MODE (pont: $AP_BRIDGE_NAME, eth: ${AP_BRIDGE_ETH:-auto})"
log "Configuration pont (si mode pont activé dans l'interface) : pont=$AP_BRIDGE_NAME, eth=${AP_BRIDGE_ETH:-auto}"
# 2. NetworkManager : gère UNIQUEMENT l'interface Wi-Fi (l'interface Ethernet hôte ne doit JAMAIS être gérée par NM dans le conteneur)
mkdir -p /etc/NetworkManager/conf.d /run/dbus /run/NetworkManager /var/run/apache2 /var/lock/apache2 /var/log/apache2 /data /etc/wireguard /etc/openvpn /run/ap-vpn /dev/net
@@ -134,11 +133,6 @@ if [[ -f /run/ap-created-bridge ]]; then
rm -f /run/ap-created-bridge 2>/dev/null || true
fi
# En mode AP (par défaut), s'assurer que la base de données ne force pas un ancien mode pont résiduel
if [[ "${AP_MODE:-ap}" == "ap" ]] && [[ -f /data/ap-dashboard.sqlite3 ]]; then
sqlite3 /data/ap-dashboard.sqlite3 "UPDATE preferences SET value='ap' WHERE key='mode' AND value='bridge';" 2>/dev/null || true
fi
# Les interfaces physiques Ethernet et autres interfaces hôtes restent strictement non-gérées (unmanaged) par NetworkManager
cat > /etc/NetworkManager/conf.d/10-ap.conf <<EOF
[main]