diff --git a/scripts/lantern.py b/scripts/lantern.py index 8cb3ced..912ce5e 100644 --- a/scripts/lantern.py +++ b/scripts/lantern.py @@ -9,7 +9,7 @@ import urllib def main(): - os.system('clear') + #os.system('clear') proxies = { 'http': 'socks5h://127.0.0.1:9050', 'https': 'socks5h://127.0.0.1:9050' @@ -17,6 +17,24 @@ def main(): rootpath='/srv/darknet-lantern/' urlpath=pwd.getpwuid(os.getuid()).pw_dir+"/.darknet_participant_url" + participantsdir=rootpath+'www/participants/' + officialparticipants=rootpath+'www/.official_participants' + + # check if /srv/darknet-lantern/www/participants directory exists, + if not os.path.isdir(participantsdir): + print("participants directory doesnt exist, creating it") + os.makedirs(participantsdir) + # iterate over /srv/darknet-lantern/www/.official_participants, list each line + with open(officialparticipants, 'r') as file: + # for each line (which is a participant): + for line in file: + participantdir=participantsdir+line.strip() + # check if the directory exists + if not os.path.isdir(participantdir): + #if not, create it + print("Official participan ",line.strip() , "'s directory doesnt exist, creating it") + os.makedirs(participantdir) + print_colors(""" diff --git a/www/.known_participants b/www/.official_participants similarity index 100% rename from www/.known_participants rename to www/.official_participants