#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/rsyslogd-tools-list-nftable List nftables filter table # # Copyright (c) 2001-2022 Ansgar Puester # # Creation: 24.05.2019 ap # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib # set package name package_name=rsyslogd # include package configuration . /etc/config.d/${package_name} pgmname=`basename $0` # rsyslogd working directory rsyslog_workdirectory=/usr/lib/rsyslog/workdir # nft command nft_command=/usr/sbin/nft # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { clrhome mecho mecho mecho --info "rsyslogd List nftables filter table" mecho if [ "$RSYSLOGD_ALLOWED_SENDER_N" = 0 ] then mecho --error "RSYSLOGD_ALLOWED_SENDER_N was set to '0', no action possible." anykey exit 1 fi # short check for nft command if [ -f ${nft_command} ] then # check if table rsyslog_filters exists ${nft_command} -n -n -a list table rsyslogd_filter > /dev/null 2>&1 RC=$? if [ "$RC" = 0 ] then ${nft_command} -n -n -a list table rsyslogd_filter else mecho --error "Filter table rsyslogd_filter does not exist!" anykey exit 1 fi else mecho --error "${nft_command} not found." anykey exit 1 fi anykey } # --------------------------------------------------------------------------- # call function main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------