From 1d3242006cca9d78009667f06ad4d73b1bb2ef54 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 9 Jun 2025 19:34:00 +0100 Subject: op-mode: T7527: move assorted embedded shel snippets to script files --- src/op_mode/install_mok.sh | 7 +++++++ src/op_mode/show_bonding_detail.sh | 7 +++++++ src/op_mode/show_ppp_stats.sh | 5 +++++ src/op_mode/update_suricata.sh | 8 ++++++++ 4 files changed, 27 insertions(+) create mode 100755 src/op_mode/install_mok.sh create mode 100755 src/op_mode/show_bonding_detail.sh create mode 100755 src/op_mode/show_ppp_stats.sh create mode 100755 src/op_mode/update_suricata.sh (limited to 'src') diff --git a/src/op_mode/install_mok.sh b/src/op_mode/install_mok.sh new file mode 100755 index 000000000..29f78cd1f --- /dev/null +++ b/src/op_mode/install_mok.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if test -f /var/lib/shim-signed/mok/vyos-dev-2025-shim.der; then + mokutil --ignore-keyring --import /var/lib/shim-signed/mok/vyos-dev-2025-shim.der; +else + echo "Secure Boot Machine Owner Key not found"; +fi diff --git a/src/op_mode/show_bonding_detail.sh b/src/op_mode/show_bonding_detail.sh new file mode 100755 index 000000000..62265daa2 --- /dev/null +++ b/src/op_mode/show_bonding_detail.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -f "/proc/net/bonding/$1" ]; then + cat "/proc/net/bonding/$1"; +else + echo "Interface $1 does not exist!"; +fi diff --git a/src/op_mode/show_ppp_stats.sh b/src/op_mode/show_ppp_stats.sh new file mode 100755 index 000000000..d9c17f966 --- /dev/null +++ b/src/op_mode/show_ppp_stats.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +if [ -d "/sys/class/net/$1" ]; then + /usr/sbin/pppstats "$1"; +fi diff --git a/src/op_mode/update_suricata.sh b/src/op_mode/update_suricata.sh new file mode 100755 index 000000000..6e4e605f4 --- /dev/null +++ b/src/op_mode/update_suricata.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if test -f /run/suricata/suricata.yaml; then + suricata-update --suricata-conf /run/suricata/suricata.yaml; + systemctl restart suricata; +else + echo "Service Suricata not configured"; +fi -- cgit v1.2.3