From 38345004720d640ac474a0c14cdc09b8414dfe0c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 28 Sep 2021 17:04:04 -0400 Subject: Show /var/log/messages after catsit command --- catsit.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'catsit.in') diff --git a/catsit.in b/catsit.in index 6e934f1..0d28a1d 100644 --- a/catsit.in +++ b/catsit.in @@ -8,18 +8,20 @@ die() { : ${CATSITD_PIPE:='%%RUNDIR%%/catsitd.pipe'} -while getopts 'c:' opt; do - case "${opt}" in +quiet= +while getopts 'c:q' opt; do + case $opt in (c) CATSITD_PIPE=$OPTARG;; + (q) quiet=q;; (?) exit 1;; esac done shift $((OPTIND - 1)) -if ! [ -p "${CATSITD_PIPE}" ]; then +if ! test -p "${CATSITD_PIPE}"; then die "${CATSITD_PIPE} is not a named pipe" fi -if ! [ -w "${CATSITD_PIPE}" ]; then +if ! test -w "${CATSITD_PIPE}"; then die "${CATSITD_PIPE} is not writable" fi @@ -35,3 +37,7 @@ if [ "${action}" != "${valid}" ]; then fi echo "$@" > "${CATSITD_PIPE}" +test $quiet && exit + +sleep 0.1 +tail /var/log/messages | grep catsitd -- cgit 1.4.1