From 78d5feda50e0d05e25fd1d5754f84a177bb4a088 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 22:55:12 +0000 Subject: [PATCH 1/2] Initial plan From 6922211f74892dff70aea87109c69e414c426242 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 23:01:00 +0000 Subject: [PATCH 2/2] Add protocol list display functionality for container creation Co-authored-by: horner <6094599+horner@users.noreply.github.com> --- .../get-lxc-container-details.sh | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/container-creation/get-lxc-container-details.sh b/container-creation/get-lxc-container-details.sh index 148900f2..5e4ee9b6 100644 --- a/container-creation/get-lxc-container-details.sh +++ b/container-creation/get-lxc-container-details.sh @@ -173,6 +173,21 @@ protocol_duplicate() { return 1 # Protocol is not a duplicate } +show_available_protocols() { + echo "" + echo "📋 Available Protocols:" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + # Display protocols in a more readable format showing abbreviation, port, and type + while read line; do + protocol_abbrev=$(echo "$line" | awk '{print $1}') + protocol_port=$(echo "$line" | awk '{print $2}') + protocol_type=$(echo "$line" | awk '{print $3}') + printf "%-12s Port %-6s (%s)\n" "$protocol_abbrev" "$protocol_port" "$protocol_type" + done < "/root/bin/protocols/master_protocol_list.txt" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" +} + read -p "Does your Container require any protocols other than SSH and HTTP? (y/n) → " USE_OTHER_PROTOCOLS while [ "${USE_OTHER_PROTOCOLS^^}" != "Y" ] && [ "${USE_OTHER_PROTOCOLS^^}" != "N" ] && [ "${USER_OTHER_PROTOCOLS^^}" != "" ]; do echo "Please answer 'y' for yes or 'n' for no." @@ -187,8 +202,13 @@ if [ "${USE_OTHER_PROTOCOLS^^}" == "Y" ]; then touch "$PROTOCOL_FILE" LIST_PROTOCOLS=() - read -p "Enter the protocol abbreviation (e.g, LDAP for Lightweight Directory Access Protocol). Type \"e\" to exit → " PROTOCOL_NAME + read -p "Enter the protocol abbreviation (e.g, LDAP for Lightweight Directory Access Protocol). Type \"list\" to see available protocols or \"e\" to exit → " PROTOCOL_NAME while [ "${PROTOCOL_NAME^^}" != "E" ]; do + if [ "${PROTOCOL_NAME^^}" == "LIST" ]; then + show_available_protocols + read -p "Enter the protocol abbreviation (e.g, LDAP for Lightweight Directory Access Protocol). Type \"list\" to see available protocols or \"e\" to exit → " PROTOCOL_NAME + continue + fi FOUND=0 #keep track if protocol was found while read line; do PROTOCOL_ABBRV=$(echo "$line" | awk '{print $1}') @@ -213,7 +233,7 @@ if [ "${USE_OTHER_PROTOCOLS^^}" == "Y" ]; then echo "❌ Protocol ${PROTOCOL_NAME^^} not found. Please try again." fi - read -p "Enter the protocol abbreviation (e.g, LDAP for Lightweight Directory Access Protocol). Type \"e\" to exit → " PROTOCOL_NAME + read -p "Enter the protocol abbreviation (e.g, LDAP for Lightweight Directory Access Protocol). Type \"list\" to see available protocols or \"e\" to exit → " PROTOCOL_NAME done fi