diff --git a/mac_ip.py b/mac_ip.py index e64b220..29f9d2a 100644 --- a/mac_ip.py +++ b/mac_ip.py @@ -19,6 +19,7 @@ Creates the nat set. """ +import os import logging from configparser import ConfigParser @@ -26,8 +27,10 @@ from re2oapi import Re2oAPIClient from firewall import NetfilterSet +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + CONFIG = ConfigParser() -CONFIG.read('/usr/local/firewall/config.ini') +CONFIG.read(os.path.join(BASE_DIR, 'config.ini')) api_hostname = CONFIG.get('Re2o', 'hostname') api_password = CONFIG.get('Re2o', 'password')