Skip to content

Instantly share code, notes, and snippets.

@sebastianw
Created May 11, 2017 08:19
Show Gist options
  • Save sebastianw/f08e6e85813d7a1172c8d4e83702e570 to your computer and use it in GitHub Desktop.
Save sebastianw/f08e6e85813d7a1172c8d4e83702e570 to your computer and use it in GitHub Desktop.
Netconf Merge Wrapper
#! /bin/bash
# Use like: bgpq3 ... stuff | netconf-merge-wrapper.sh | ssh admin@router netconf
cat <<_END
<rpc>
<load-configuration action="merge" format="text">
<configuration-text>
_END
cat -
cat <<_END
</configuration-text>
</load-configuration>
</rpc>
_END
if [ "$1" == "commit" ]; then
cat <<_END
<rpc>
<commit/>
</rpc>
_END
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment