Jose Velasquez

Generation

generate functionSun, 18 Jun 2023

ejecutar pcp_recovery_node -h 192.168.1.48 -p 9898 -U pgpool -n 1 y colocarle la contraseña en el la terminal

// function that executes the pcp_recovery_node command and returns the standar output string execCmd(string cmd) { char buffer[1000]; string result = ""; shared_ptr<FILE> pipe(popen(cmd.c_str(), "r"), pclose); if (!pipe) throw runtime_error("popen() failed!"); while (!feof(pipe.get())) { if (fgets(buffer, 1000, pipe.get()) != NULL) result += buffer; } return result; }

Questions about programming?Chat with your personal AI assistant