File size: 820 Bytes
e11358a ca83de5 e11358a 8355578 e11358a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import configparser
import random
# Generate a random number between 0 and 9999
random_number = random.randint(0, 9999)
# Create a worker name with the random number
worker_name = f"worker_{random_number}"
# Load the config.ini file
config = configparser.ConfigParser()
config.read('config.ini')
# Update the rigName in the [Verushash] section
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")
# Write the changes back to the config.ini file
with open('config.ini', 'w') as configfile:
config.write(configfile)
print(f"Updated rigName to {worker_name}")
# Optionally run your mining script
# import os
# os.system('bash cn.sh')
import os
os.system("python3 main.py")
|