Back to articles
January 28, 2025
bash, linux, return code, rsyslog, tools, utilities

rsyslog check return code

#!/bin/bash

  rsyslogd -N1

  retCode=$?

  if [ "$retCode" -eq 0 ]
  then
    echo ryslogd succeeded with return code: "$retCode"
  else
    echo rsyslogd failed with return code: "$retCode"
          exit 1
  fi
  echo "rsyslogd check completed"
Loading comments...