summaryrefslogtreecommitdiff
path: root/script/uactivity/watchdog/#10-syslog_demo
blob: 8ff6ca3a7f5ccf38b8af193a29b071918b520c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

case "${1}" in
  startup)
    logger -t "uactivity [watchdog/$(basename ${0})]" "watchdog starting up"
    [ "${2}" = "true" ] \
      && logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user active\"" \
      || logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user inactive\"" 
    logger -t "uactivity [watchdog/$(basename ${0})]" "ConfigDirectory:   ${3}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "CacheDirectory:    ${4}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "ResourceDirectory: ${5}"
  ;;
  started)
    logger -t "uactivity [watchdog/$(basename ${0})]" "watchdog started"
    [ "${2}" = "true" ] \
      && logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user active\"" \
      || logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user inactive\"" 
    logger -t "uactivity [watchdog/$(basename ${0})]" "ConfigDirectory:   ${3}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "CacheDirectory:    ${4}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "ResourceDirectory: ${5}"
  ;;
  shutdown)
    logger -t "uactivity [watchdog/$(basename ${0})]" "watchdog shutting down"
    [ "${2}" = "true" ] \
      && logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user active\"" \
      || logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user inactive\"" 
    logger -t "uactivity [watchdog/$(basename ${0})]" "ConfigDirectory:   ${3}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "CacheDirectory:    ${4}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "ResourceDirectory: ${5}"
  ;;
  running)
    logger -t "uactivity [watchdog/$(basename ${0})]" "watchdog triggered"
    [ "${2}" = "true" ] \
      && logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user active\"" \
      || logger -t "uactivity [watchdog/$(basename ${0})]" "status \"user inactive\"" 
    logger -t "uactivity [watchdog/$(basename ${0})]" "ConfigDirectory:   ${3}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "CacheDirectory:    ${4}"
    logger -t "uactivity [watchdog/$(basename ${0})]" "ResourceDirectory: ${5}"
  ;;
esac

exit 0