import os from json import load from hashlib import sha256 print('Loading server...') with open('config.json', 'r') as file: config = load(file) if not os.path.isdir('plugins'): os.mkdir('plugins') if not os.path.isfile('server.jar'): os.system(f'wget -O server.jar {config["server"]}') print('Loaded server!') print('Loading plugins...') os.chdir('plugins') if os.path.isfile('downloading.jar'): os.remove('downloading.jar') for i in config['plugins']: h = sha256(i.encode()).hexdigest()[:8] if not os.path.isfile(f'{h}.jar'): os.system(f'wget \'{i}\' -O downloading.jar') os.rename('downloading.jar', f'{h}.jar') os.chdir('..') print('Loaded all plugins!')