← Back
Editing: fw_ifcfg.cpython-312.pyc
� �=jL � �H � d Z ddlZddlZddlmZ ddlmZ ddlmZ d� Z d� Z y)z.Functions to search for and change ifcfg files� N)�config)�log)�ifcfgc �P � t j j t j � syt t j t j � � D ]x }|j d� s�dD ] }|j |� s�� d|v r�3t t j �d|��� }|j � |j d� | k( s�v|c S t j �d| ��}t j j |� rt |� }|j � |S y)z6search ifcfg file for the interface in config.IFCFGDIRNzifcfg-)z.bakz.origz.rpmnewz.rpmorigz.rpmsavez-range�.�/�DEVICEz/ifcfg-)�os�path�existsr �IFCFGDIR�sorted�listdir� startswith�endswithr �read�get)� interface�filename�ignored� ifcfg_files �;/usr/lib/python3.12/site-packages/firewall/core/fw_ifcfg.py�search_ifcfg_of_interfacer s� � � �7�7�>�>�&�/�/�*���2�:�:�f�o�o�6�7���"�"�8�,��U�G�� � ��)�� V� �(�?���f�o�o�x�@�A� ������>�>�(�#�y�0��� 8� !'����;�H� �w�w�~�~�h���8�_� �������� c � � | �d} t |� }|�u|j d� | k7 r`|j d� �| dk( sIt j d| �d|j �d�� |j d| � |j � yyyy)zYSet zone (ZONE=<zone>) in the ifcfg file that uses the interface (DEVICE=<interface>)N� �ZONEz Setting ZONE=z in '�')r r r �debug1r �set�write)�zoner r s r �ifcfg_set_zone_of_interfacer# 0 s� � � �|���*�9�5�J����N�N�6�"�d�*�����'�/�D�B�J�� � ��j�6I�6I�J�K����v�t�$����� 5?� +� r )�__doc__r �os.path�firewallr �firewall.core.loggerr �firewall.core.io.ifcfgr r r# � r r �<module>r* s# �� 5� � � � $� (��<r
Save File
Cancel