Skip to content

Commit

Permalink
scripts UPDATE add ssh banner config
Browse files Browse the repository at this point in the history
  • Loading branch information
roman authored and michalvasko committed Nov 13, 2024
1 parent d7f08c5 commit 407c3e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ set(LIBYANG_DEP_SOVERSION 3.0.0)
set(LIBYANG_DEP_SOVERSION_MAJOR 3)

# libnetconf2 required version
set(LIBNETCONF2_DEP_VERSION 3.5.2)
set(LIBNETCONF2_DEP_SOVERSION 4.4.2)
set(LIBNETCONF2_DEP_VERSION 3.5.4)
set(LIBNETCONF2_DEP_SOVERSION 4.4.4)
set(LIBNETCONF2_DEP_SOVERSION_MAJOR 4)

# sysrepo required version
Expand Down Expand Up @@ -407,6 +407,7 @@ if(SYSREPO_SETUP)
message(STATUS \"Merging default server listen configuration if there is none (merge_config.sh)...\")
set(ENV{SYSREPOCTL_EXECUTABLE} \"${SYSREPOCTL_EXECUTABLE}\")
set(ENV{SYSREPOCFG_EXECUTABLE} \"${SYSREPOCFG_EXECUTABLE}\")
set(ENV{NP2_VERSION} \"${NP2SRV_VERSION}\")
execute_process(COMMAND \"\$ENV{DESTDIR}${DATA_DIR}/scripts/merge_config.sh\"
RESULT_VARIABLE CMD_RES
OUTPUT_VARIABLE CMD_OUT
Expand Down
8 changes: 8 additions & 0 deletions scripts/merge_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ if [ -n "$AUTH_CONFIG" ]; then
</users>"
fi

SSH_BANNER=""
# check if the NP2_VERSION environment variable is set
if [ -n "$NP2_VERSION" ]; then
# get the banner from the NP2_VERSION environment variable
SSH_BANNER="<banner xmlns=\"urn:cesnet:libnetconf2-netconf-server\">netopeer2-netconf-server-${NP2_VERSION}</banner>"
fi

# import default config
CONFIG="<netconf-server xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-server\">
<listen>
Expand All @@ -74,6 +81,7 @@ CONFIG="<netconf-server xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-server\
</tcp-server-parameters>
<ssh-server-parameters>
<server-identity>
${SSH_BANNER}
<host-key>
<name>default-key</name>
<public-key>
Expand Down

0 comments on commit 407c3e9

Please sign in to comment.