-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
74 lines (52 loc) · 1.71 KB
/
start.php
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
//copyright by Coloco Group
//Coloco MDC mining solutions
//website: www.coloco.biz
//For educational purpose only
include("functions/parse_config.php");
include("functions/logwrite.php");
include("pools/weminemue_api.php");
include("functions/sgminer_api.php");
$CONFIG = parse_config();
if ($CONFIG == "0") {
print("can not find config file minitor.conf\nclose application \n");
}
//starting application
print("[OK] starting...\n");
logwrite("config read ok");
logwrite("staring application");
//print_r($CONFIG);
//rin script forever
while(true) {
switch ($CONFIG["coin"]){
case "MUE":
// logwrite("requesting mue pool for check worker activity");
$request_result = request_mue();
switch ($request_result) {
case "error":
print("an error occured during pool api request or incorrect wallet address\n");
logwrite("an error occured during pool api request or incorrect wallet address");
break;
case "mining_ok":
break;
case "mining_down":
print("no mining at api reply: restart sgminer\n");
logwrite("no mining at api reply: restart sgminer");
request("restart");
print("\nsgminer restarted by api command\n");
logwrite("sgminer restarted by api command");
break;
default:
print("an unknown error occured when checking api reply\nclose applicatin\n");
logwrite("an unknown error occured when checking api reply\nclose application");
break 3;
}
break;
default:
logwrite("unknown or not defined coin in config (coin=XXX)");
print("unknown or not selected coin in config\n close application");
break 2;
}
sleep(300);
}
?>