Created
May 11, 2017 08:19
-
-
Save sebastianw/f08e6e85813d7a1172c8d4e83702e570 to your computer and use it in GitHub Desktop.
Netconf Merge Wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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