Ask Your Question

Revision history [back]

You will need to write a script name something like iw-set.sh and add it on the /usr/loca/sbin you script should be something like:

#!/bin/bash
/usr/sbin/iw reg set US

You need to set is as executable to do so:

chmod 777 /usr/local/sbin/iw-set.sh

The you should write a systemd init file

[Unit]
Description=Set iw settings
Before=NetworkManager.service

[Service]
Type=oneshot
ExecStart= /usr/loca/sbin/iw-set.sh

[Install]
WantedBy=multi-user.target

This file should be placed on /etc/systemd/system/ named something iw-set.service and with 664 permits so

chmod 664 /etc/systemd/system/iw-set.service

Then you can test ti by issueing

systemctl daemon-reload
systemctl start iw-set.service

if all goes well you could enable at boot with

systemctl enable iw-set.service

While I have not tested, will recommend you to read systemd documentation and google a bit. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Unit_Files.html

All that been said, I think it should be a way to set those parameters on NetworkManager it self, but not sure. Try google.