From 2ddf9448fe26f4501ab78097ca7dd30e8f4bd008 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 8 Feb 2023 09:39:02 +0100 Subject: [PATCH] board/common: enable NETCONF over SSH The allows remote NETCONF access to the Clixon example (for now). This will be replaced later with the Clixon Infix system. Signed-off-by: Joachim Wiberg --- board/common/post-build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/board/common/post-build.sh b/board/common/post-build.sh index 745d1269..8dffb4d6 100755 --- a/board/common/post-build.sh +++ b/board/common/post-build.sh @@ -32,3 +32,10 @@ if [ -f "$TARGET_DIR/etc/dhcpcd.conf" ]; then EOF fi fi + +# Enable NETCONF over SSH +if [ -f "$TARGET_DIR/etc/ssh/sshd_config" ]; then + if ! grep -q clixon_netconf "$TARGET_DIR/etc/ssh/sshd_config"; then + sed -i '/^Subsystem[[:space:]]sftp.*/a Subsystem netconf /usr/bin/clixon_netconf -f /etc/example.xml' "$TARGET_DIR/etc/ssh/sshd_config" + fi +fi