Skip to content

Commit 5d205ff

Browse files
committed
Ajout de la configuration DNS pour wlan0 et vérification de l'existence du fichier de configuration.
1 parent 2049e09 commit 5d205ff

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

archlinux/install/config/systemd.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ EOF
3030
sudo rm /etc/resolv.conf
3131
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
3232

33+
# Create config to force wlan0 to use network DNS settings
34+
local wlan0_config_file="/etc/systemd/network/25-wlan0.network"
35+
36+
if [ ! -f "$wlan0_config_file" ]; then
37+
echo "Creating wlan0 DNS priority configuration..."
38+
sudo tee "$wlan0_config_file" > /dev/null << 'EOF'
39+
[Match]
40+
Name=wlan0
41+
42+
[Network]
43+
DHCP=yes
44+
45+
[DHCPv4]
46+
UseDNS=yes
47+
48+
[Network]
49+
Domains=~.
50+
EOF
51+
fi
52+
3353
sudo systemctl enable --now systemd-resolved.service
3454
}
3555

@@ -70,5 +90,11 @@ function check(){
7090
return
7191
fi
7292

93+
# Check if wlan0 config file exists
94+
if [ ! -f "/etc/systemd/network/25-wlan0.network" ]; then
95+
show_error "Systemd" "/etc/systemd/network/25-wlan0.network does not exist."
96+
return
97+
fi
98+
7399
show_success "Systemd and systemd-resolved are properly configured."
74100
}

0 commit comments

Comments
 (0)