v0.0.75 - Add rsync deploy script and wizard root-shell handoff for service install path
This commit is contained in:
+18
-1
@@ -1373,7 +1373,24 @@ static int install_system_service_with_dedicated_user(const didactyl_config_t* c
|
||||
if (!cfg || cfg->keys.nsec[0] == '\0') return -1;
|
||||
|
||||
if (geteuid() != 0) {
|
||||
fprintf(stderr, "%sSystem install requires root (run with sudo).%s\n", ANSI_RED, ANSI_RESET);
|
||||
fprintf(stderr, "%sSystem install requires root.%s\n", ANSI_RED, ANSI_RESET);
|
||||
fprintf(stderr, " You can open a root shell now and then re-run this install step.\n");
|
||||
print_option('o', "pen root shell now (sudo -i)");
|
||||
print_option('r', "eturn without installing");
|
||||
wizard_option_t root_opts[] = {{'o', ""}, {'r', ""}};
|
||||
char root_choice = read_menu_choice(root_opts, 2);
|
||||
|
||||
if (root_choice == 'o') {
|
||||
char* sudo_argv[] = {"sudo", "-i", NULL};
|
||||
if (run_command_local(sudo_argv) != 0) {
|
||||
fprintf(stderr, "%sFailed to open root shell via sudo.%s\n", ANSI_RED, ANSI_RESET);
|
||||
} else {
|
||||
fprintf(stderr, "%sReturned from root shell.%s\n", ANSI_YELLOW, ANSI_RESET);
|
||||
}
|
||||
fprintf(stderr,
|
||||
" Re-run didactyl as root and choose install again to complete system service setup.\n");
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user