summaryrefslogtreecommitdiffstats
path: root/snapcraft/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'snapcraft/scripts')
-rw-r--r--snapcraft/scripts/bgpd-service9
-rwxr-xr-xsnapcraft/scripts/set-options25
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