mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Make it possible to enter server credentials with curses input if none are specified on the command line.
This commit is contained in:
parent
2b7e5e58c8
commit
365c90096c
45
main.c
45
main.c
@ -2629,9 +2629,6 @@ int main (int argc, char *argv[])
|
||||
if (argc != 1)
|
||||
quit(1, "Unexpected extra commandline arguments");
|
||||
|
||||
if (!total_pools)
|
||||
quit(1, "No server specified");
|
||||
|
||||
if (total_devices) {
|
||||
if (total_devices > nDevs)
|
||||
quit(1, "More devices specified than exist");
|
||||
@ -2671,6 +2668,48 @@ int main (int argc, char *argv[])
|
||||
test_and_set(&curses_active);
|
||||
}
|
||||
|
||||
if (!total_pools) {
|
||||
if (curses_active) {
|
||||
char *input, *seterr;
|
||||
|
||||
immedok(logwin, true);
|
||||
leaveok(logwin, false);
|
||||
wprintw(logwin, "No server specified on command line. Enter details manually\n");
|
||||
|
||||
input = malloc(255);
|
||||
if (!input)
|
||||
quit(1, "Failed to malloc input");
|
||||
wprintw(logwin, "URL: ");
|
||||
wgetnstr(logwin, input, 255);
|
||||
seterr = set_url(input, NULL);
|
||||
if (seterr)
|
||||
quit(1, "%s", seterr);
|
||||
|
||||
input = malloc(255);
|
||||
if (!input)
|
||||
quit(1, "Failed to malloc input");
|
||||
wprintw(logwin, "Username: ");
|
||||
wgetnstr(logwin, input, 255);
|
||||
seterr = set_user(input, NULL);
|
||||
if (seterr)
|
||||
quit(1, "%s", seterr);
|
||||
|
||||
input = malloc(255);
|
||||
if (!input)
|
||||
quit(1, "Failed to malloc input");
|
||||
wprintw(logwin, "Password: ");
|
||||
wgetnstr(logwin, input, 255);
|
||||
seterr = set_pass(input, NULL);
|
||||
if (seterr)
|
||||
quit(1, "%s", seterr);
|
||||
|
||||
wclear(logwin);
|
||||
leaveok(logwin, true);
|
||||
immedok(logwin, false);
|
||||
} else
|
||||
quit(1, "No server specified");
|
||||
}
|
||||
|
||||
for (i = 0; i < total_pools; i++) {
|
||||
struct pool *pool = &pools[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user