File: functions.inc

package info (click to toggle)
open-isns 0.101-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,420 kB
  • sloc: ansic: 19,981; sh: 3,211; python: 1,083; perl: 839; makefile: 214
file content (23 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
die()
{
  echo "$@" >&2
  exit 1
}

service_status()
{
  if [ x"$1" = x"NOFAIL" ] ; then
    shift
    _R=":"
  else
    _R="die FAILURE"
  fi
  for service in "$@" ; do
    echo "Status of ${service}:"
    service "${service}" status || ${_R}
    if [ -d /run/systemd/system ] ; then
      echo "Journal log of ${service}:"
      journalctl -u "${service}".service || ${_R}
    fi
  done
}