diff --git a/nat.py b/nat.py index 2af9011..3dca8d6 100644 --- a/nat.py +++ b/nat.py @@ -95,7 +95,10 @@ def main(): nat_log += aloes_nat.manage() logging.info("Done.") - filename = "/var/log/nat-%s.log" % ctime + nat_directory = "/var/log/nat/" + if not os.path.exists(nat_directory): + os.makedirs(nat_directory) + filename = os.path.join(nat_directory, "nat_%s.log" % time.strftime('%Y_%m_%d_%Hh_%Mm')) logging.info("Saving nat table into " + filename) with open(filename, 'a') as f: