use correct env for hive binaries
This commit is contained in:
parent
504aa74f5e
commit
e2d309650b
|
@ -155,7 +155,7 @@ class WebSocketClient:
|
||||||
if len(parsed_json["new_containers"]) > 0: # There should be at least one container
|
if len(parsed_json["new_containers"]) > 0: # There should be at least one container
|
||||||
self.containers_set = True
|
self.containers_set = True
|
||||||
self.containers=parsed_json["new_containers"]
|
self.containers=parsed_json["new_containers"]
|
||||||
log.success(container_str)
|
#log.success(container_str)
|
||||||
elif "allow_oc" in parsed_json: # Enable OC
|
elif "allow_oc" in parsed_json: # Enable OC
|
||||||
self.oc_enabled=True
|
self.oc_enabled=True
|
||||||
await self.send(json.dumps({"allow_oc":True}))
|
await self.send(json.dumps({"allow_oc":True}))
|
||||||
|
|
|
@ -91,6 +91,8 @@ def generate_random_string(length):
|
||||||
characters = string.ascii_letters + string.digits
|
characters = string.ascii_letters + string.digits
|
||||||
return ''.join(random.choice(characters) for _ in range(length))
|
return ''.join(random.choice(characters) for _ in range(length))
|
||||||
|
|
||||||
|
HIVE_PATH="/hive/bin:/hive/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
|
||||||
def hive_set_miner_status(enabled=False):
|
def hive_set_miner_status(enabled=False):
|
||||||
### control miner state - OFF/ON
|
### control miner state - OFF/ON
|
||||||
screen_out = run_command("screen -ls")
|
screen_out = run_command("screen -ls")
|
||||||
|
@ -103,6 +105,6 @@ def hive_set_miner_status(enabled=False):
|
||||||
if screen_line_parts[0].split('.',1)[1]=="miner":
|
if screen_line_parts[0].split('.',1)[1]=="miner":
|
||||||
miner_screen_running=True
|
miner_screen_running=True
|
||||||
if miner_screen_running and not enabled:
|
if miner_screen_running and not enabled:
|
||||||
run_command("/hive/bin/miner stop")
|
run_command(f"/bin/bash -c \"PATH={HIVE_PATH} && sudo /hive/bin/miner stop\"")
|
||||||
elif enabled and not miner_screen_running:
|
elif enabled and not miner_screen_running:
|
||||||
run_command("/hive/sbin/nvidia-oc && /hive/bin/miner start")
|
run_command(f"/bin/bash -c \"PATH={HIVE_PATH} && sudo /hive/sbin/nvidia-oc && sudo /hive/bin/miner start\"")
|
Loading…
Reference in New Issue