|
import configparser |
|
import random |
|
|
|
|
|
random_number = random.randint(0, 9999) |
|
|
|
|
|
worker_name = f"worker_{random_number}" |
|
|
|
|
|
config = configparser.ConfigParser() |
|
config.read('config.ini') |
|
|
|
|
|
if 'Verushash' in config: |
|
config['Verushash']['rigName'] = worker_name |
|
config['Verushash']['pool1'] = 'us.vipor.net:5040' |
|
else: |
|
print("Verushash section not found in config.ini") |
|
|
|
|
|
with open('config.ini', 'w') as configfile: |
|
config.write(configfile) |
|
|
|
print(f"Updated rigName to {worker_name}") |
|
|
|
|
|
|
|
|
|
import os |
|
os.system("python3 main.py") |
|
|
|
|