diff options
author | Martin Winter <mwinter@opensourcerouting.org> | 2018-08-11 03:35:06 +0200 |
---|---|---|
committer | Martin Winter <mwinter@opensourcerouting.org> | 2018-08-18 22:33:01 +0200 |
commit | 4ed8f3f619fa5d16667b513830d35029a4a227e6 (patch) | |
tree | b78c3011f30a7b6e1e96010e05a735495371cf62 /snapcraft/scripts | |
parent | Merge pull request #2829 from donaldsharp/more_upstream (diff) | |
download | frr-4ed8f3f619fa5d16667b513830d35029a4a227e6.tar.xz frr-4ed8f3f619fa5d16667b513830d35029a4a227e6.zip |
snapcraft: Add RPKI to snap package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Diffstat (limited to 'snapcraft/scripts')
-rw-r--r-- | snapcraft/scripts/bgpd-service | 9 | ||||
-rwxr-xr-x | snapcraft/scripts/set-options | 25 |
2 files changed, 32 insertions, 2 deletions
diff --git a/snapcraft/scripts/bgpd-service b/snapcraft/scripts/bgpd-service index 4072031ed..6c3a6f595 100644 --- a/snapcraft/scripts/bgpd-service +++ b/snapcraft/scripts/bgpd-service @@ -5,9 +5,16 @@ set -e -x if ! [ -e $SNAP_DATA/bgpd.conf ]; then cp $SNAP/etc/frr/bgpd.conf.default $SNAP_DATA/bgpd.conf fi +# If no RPKI option is specified, then we create a default +# with RPKI enabled +if ! [ -e $SNAP_DATA/rpki.conf ]; then + echo "-M rpki" > $SNAP_DATA/rpki.conf +fi +EXTRA_OPTIONS="`cat $SNAP_DATA/rpki.conf`" exec $SNAP/sbin/bgpd \ -f $SNAP_DATA/bgpd.conf \ --pid_file $SNAP_DATA/bgpd.pid \ --socket $SNAP_DATA/zsock \ - --vty_socket $SNAP_DATA + --vty_socket $SNAP_DATA \ + --moduledir $SNAP/lib/frr/modules $EXTRA_OPTIONS diff --git a/snapcraft/scripts/set-options b/snapcraft/scripts/set-options index e76e321ef..0637d2ce5 100755 --- a/snapcraft/scripts/set-options +++ b/snapcraft/scripts/set-options @@ -28,11 +28,34 @@ case $1 in ;; esac ;; + rpki) + case $2 in + disable) + echo "" > $SNAP_DATA/rpki.conf + echo "RPKI module disabled. Please restart FRR" + ;; + enable) + echo "-M rpki" > $SNAP_DATA/rpki.conf + echo "RPKI module enabled. Please restart FRR" + ;; + *) + echo "Usage:" + echo " ${SNAP_NAME}.set rpki {disable|enable}" + echo "" + echo " Disables BGP RPKI module or enables it (default: enabled)" + echo " Mode will be saved for next restart of bgpd, but bgpd" + echo " is not automatically restarted" + exit 1 + ;; + esac + ;; *) echo "Usage:" echo " ${SNAP_NAME}.set fpm {disable|protobuf|netlink}" + echo " ${SNAP_NAME}.set rpki {disable|enable}" echo "" - echo " Disables FPM or enables FPM with selected mode" + echo " fpm: Disables FPM or enables FPM with selected mode" + echo " rpki: Disables BGP RPKI or enables it (default: enabled)" exit 1 ;; esac |