diff --git a/IP_List_generator/ip_gen.py b/IP_List_generator/ip_gen.py index b5b8e73..20e6d68 100644 --- a/IP_List_generator/ip_gen.py +++ b/IP_List_generator/ip_gen.py @@ -54,6 +54,31 @@ def htaccess(input, output): else: pass + +""" +Must be in IP List Format!! +""" +def combine(destination, fileadd): + # Append List + with open(fileadd ,'r') as f: + readinput = f.read().splitlines() + with open(destination, 'a') as f: + for line in readinput: + f.write(line + "\n") + f.close() + # Clear Duplicated + with open(destination, 'r') as f: + lines = set(f.readlines()) + with open(destination, 'w') as f: + f.writelines(set(lines)) + f.close() + # Sort + with open(destination, 'r') as f: + lines = sorted(f.readlines()) + with open(destination, 'w') as f: + for line in lines: + f.write(line) + def BuildDate(): UTC = pytz.utc date = datetime.datetime.now(UTC)