| 130 | } |
| 131 | |
| 132 | int NodeWizardCommand::AgentSatelliteSetup() const |
| 133 | { |
| 134 | std::string answer; |
| 135 | String choice; |
| 136 | bool connectToParent = false; |
| 137 | |
| 138 | std::cout << "Starting the Agent/Satellite setup routine...\n\n"; |
| 139 | |
| 140 | /* CN */ |
| 141 | std::cout << ConsoleColorTag(Console_Bold) |
| 142 | << "Please specify the common name (CN)" |
| 143 | << ConsoleColorTag(Console_Normal) |
| 144 | << " [" << Utility::GetFQDN() << "]: "; |
| 145 | |
| 146 | std::getline(std::cin, answer); |
| 147 | |
| 148 | if (answer.empty()) |
| 149 | answer = Utility::GetFQDN(); |
| 150 | |
| 151 | String cn = answer; |
| 152 | cn = cn.Trim(); |
| 153 | |
| 154 | std::vector<std::string> endpoints; |
| 155 | |
| 156 | String endpointBuffer; |
| 157 | |
| 158 | std::cout << ConsoleColorTag(Console_Bold) |
| 159 | << "\nPlease specify the parent endpoint(s) (master or satellite) where this node should connect to:" |
| 160 | << ConsoleColorTag(Console_Normal) << "\n"; |
| 161 | String parentEndpointName; |
| 162 | |
| 163 | wizard_endpoint_loop_start: |
| 164 | |
| 165 | std::cout << ConsoleColorTag(Console_Bold) |
| 166 | << "Master/Satellite Common Name" << ConsoleColorTag(Console_Normal) |
| 167 | << " (CN from your master/satellite node): "; |
| 168 | |
| 169 | std::getline(std::cin, answer); |
| 170 | |
| 171 | if (answer.empty()) { |
| 172 | Log(LogWarning, "cli", "Master/Satellite CN is required! Please retry."); |
| 173 | goto wizard_endpoint_loop_start; |
| 174 | } |
| 175 | |
| 176 | endpointBuffer = answer; |
| 177 | endpointBuffer = endpointBuffer.Trim(); |
| 178 | |
| 179 | std::cout << "\nDo you want to establish a connection to the parent node " |
| 180 | << ConsoleColorTag(Console_Bold) << "from this node?" |
| 181 | << ConsoleColorTag(Console_Normal) << " [Y/n]: "; |
| 182 | |
| 183 | std::getline (std::cin, answer); |
| 184 | boost::algorithm::to_lower(answer); |
| 185 | choice = answer; |
| 186 | |
| 187 | String parentEndpointPort = "5665"; |
| 188 | |
| 189 | if (choice.Contains("n")) { |
nothing calls this directly
no test coverage detected