-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
73 lines (70 loc) · 2.35 KB
/
main.cpp
File metadata and controls
73 lines (70 loc) · 2.35 KB
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
#include <iostream>
#include <stdlib.h>
#include <minepeonuiupdate.h>
using namespace std;
char yourch;
int system(const char *command);
int main()
{
cout << "########################################" << endl;
cout << "# MinePeon Console Menu (c++ version) #" << endl;
cout << "########################################" << endl;
cout << "# [a] Miner Screen (CTRL-A-D to exit) #" << endl;
cout << "# [b] Change console password #" << endl;
cout << "# [c] Stop Miner #" << endl;
cout << "# [d] Start Miner #" << endl;
cout << "# [e] Retart Miner #" << endl;
cout << "# [f] Update MinePeon #" << endl;
cout << "# [g] Update MinePeon Configuration #" << endl;
cout << "# [h] Update ArchLinux #" << endl;
cout << "# [z] Reboot MinePeon #" << endl;
cout << "# [0] Exit to shell #" << endl;
cout << "########################################" << endl;
cout << "# [Some options require your password] #" << endl;
cout << "# [ Exit to shell and type logout to ] #" << endl;
cout << "# [ Exit System ] #" << endl;
cout << "########################################" << endl;
cout << "Enter your menu choice [a-0]: " << endl;
cin >> yourch;
switch (yourch) {
case 'a':
system("/usr/bin/screen -r");
break;
case 'b':
system("/usr/bin/passwd");
break;
case 'c':
system("/usr/bin/sudo /usr/bin/systemctl stop miner");
break;
case 'd':
system("/usr/bin/sudo /usr/bin/systemctl start miner");
break;
case 'e':
system("/usr/bin/sudo /usr/bin/systemctl restart miner");
break;
case 'f':
//Own Header file
break;
case 'g':
//Own Header file
break;
case 'h':
//Own Header file
break;
case 'z':
system("/usr/bin/sudo /usr/bin/reboot");
break;
case '0':
return 0;
break;
default:
cout << string(50, '\n');
cout << "Oopps!!! Please select a valid menu choice..." << endl;
cout << "Try agian, press Enter to continue" << endl;
cin.get();
cin.ignore();
main();
break;
}
return 0;
}