Skip to content

Commit 937f4ff

Browse files
authored
Merge pull request #6142 from rvykydal/update-autoconnection-config-for-centos
network: update NM autoconnections configuration for centos
2 parents 2a98e56 + bcbf2db commit 937f4ff

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

data/systemd/anaconda-nm-disable-autocons-rhel.service

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
ConditionKernelCommandLine=|ip
33
ConditionKernelCommandLine=|inst.ks
44
ConditionKernelCommandLine=|BOOTIF
5-
ConditionOSRelease=ID=rhel
65
Description=NetworkManager autoconnections configuration for Anaconda installation environment for RHEL
76
Before=NetworkManager.service
87

98
[Service]
109
Type=oneshot
11-
ExecStart=/usr/bin/anaconda-nm-disable-autocons
10+
ExecStart=/usr/bin/anaconda-nm-disable-autocons rhel

scripts/anaconda-nm-disable-autocons

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
# Disable only on system with rhel policy (RHEL, CentOS, Alma Linux, Rocky Linux, ...)
4+
if [ "$1" == "rhel" ]; then
5+
source /etc/os-release
6+
if [[ ! "${ID}" == "rhel" ]] && [[ ! "${ID}" == "centos" ]] && [[ ! "${ID_LIKE}" =~ "rhel" ]]; then
7+
echo "Skipping the RHEL NM autoconnections policy setting on system with ID: ${ID}, ID_LIKE: ${ID_LIKE}."
8+
exit 0
9+
fi
10+
fi
11+
12+
echo "Disabling NetworkManager autoconnections."
213
cat > /etc/NetworkManager/conf.d/90-anaconda-no-auto-default.conf << EOF
314
[main]
415
no-auto-default=*

0 commit comments

Comments
 (0)