summaryrefslogtreecommitdiffstats
path: root/snapcraft/scripts/set-options
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:53:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:53:30 +0000
commit2c7cac91ed6e7db0f6937923d2b57f97dbdbc337 (patch)
treec05dc0f8e6aa3accc84e3e5cffc933ed94941383 /snapcraft/scripts/set-options
parentInitial commit. (diff)
downloadfrr-2c7cac91ed6e7db0f6937923d2b57f97dbdbc337.tar.xz
frr-2c7cac91ed6e7db0f6937923d2b57f97dbdbc337.zip
Adding upstream version 8.4.4.upstream/8.4.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xsnapcraft/scripts/set-options63
1 files changed, 63 insertions, 0 deletions
diff --git a/snapcraft/scripts/set-options b/snapcraft/scripts/set-options
new file mode 100755
index 0000000..0637d2c
--- /dev/null
+++ b/snapcraft/scripts/set-options
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+set -e
+
+case $1 in
+ fpm)
+ case $2 in
+ disable)
+ rm -f $SNAP_DATA/fpm.conf
+ echo "FPM module disabled. Please restart FRR"
+ ;;
+ protobuf)
+ echo "-M fpm:protobuf" > $SNAP_DATA/fpm.conf
+ echo "FPM enabled and set to protobuf mode. Please restart FRR"
+ ;;
+ netlink)
+ echo "-M fpm:netlink" > $SNAP_DATA/fpm.conf
+ echo "FPM enabled and set to netlink mode. Please restart FRR"
+ ;;
+ *)
+ echo "Usage:"
+ echo " ${SNAP_NAME}.set fpm {disable|protobuf|netlink}"
+ echo ""
+ echo " Disables FPM module or enables it with specified mode"
+ echo " Mode will be saved for next restart of zebra, but zebra"
+ echo " is not automatically restarted"
+ exit 1
+ ;;
+ 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 " fpm: Disables FPM or enables FPM with selected mode"
+ echo " rpki: Disables BGP RPKI or enables it (default: enabled)"
+ exit 1
+ ;;
+esac
+
+exit 0