#!/bin/sh # # Copyright (c) 2019 Dovecot authors, see the included COPYING file */ # # This script is intended to be called by the script service and to be # connected to a socket using a service configuration like this: # executable = script -p /path/to/health-check.sh # # This simple example merely answers "PONG\n" if the input is "PING\n". It # stops waiting for input after $timeout which causes the process to die # which causes the script module to close the socket. Inputs and outputs # can be written to STDIN and STDOUT, they are duplicated file-descriptors # if called from the script service. timeout=10 # timeout the read via trap for POSIX shell compatibility trap "exit 0" QUIT { sleep $timeout kill -3 $$ 2>/dev/null } & read -r input exit_code=$? cleaned_input=$(echo ${input} | sed "s/[^a-zA-Z0-9]//g") if [ ${exit_code} -eq 0 ] && [ "${cleaned_input}" = "PING" ];then echo "PONG" fi # always exit successful exit 0
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
aggregator | File | 67.29 KB | 0755 |
|
anvil | File | 71.7 KB | 0755 |
|
auth | File | 1.98 MB | 0755 |
|
checkpassword-reply | File | 20.08 KB | 0755 |
|
config | File | 482.16 KB | 0755 |
|
decode2text.sh | File | 2.77 KB | 0755 |
|
deliver | File | 104.45 KB | 0755 |
|
dict | File | 409.95 KB | 0755 |
|
director | File | 576.32 KB | 0755 |
|
dns-client | File | 43.19 KB | 0755 |
|
doveadm-server | File | 2.82 MB | 0755 |
|
dovecot-lda | File | 104.45 KB | 0755 |
|
gdbhelper | File | 18.9 KB | 0755 |
|
health-check.sh | File | 943 B | 0755 |
|
imap | File | 1.66 MB | 0755 |
|
imap-hibernate | File | 132.3 KB | 0755 |
|
imap-login | File | 161.62 KB | 0755 |
|
imap-urlauth | File | 78.8 KB | 0755 |
|
imap-urlauth-login | File | 47.05 KB | 0755 |
|
imap-urlauth-worker | File | 210.52 KB | 0755 |
|
indexer | File | 97.86 KB | 0755 |
|
indexer-worker | File | 109.48 KB | 0755 |
|
ipc | File | 74.86 KB | 0755 |
|
lmtp | File | 315.25 KB | 0755 |
|
log | File | 89.45 KB | 0755 |
|
maildirlock | File | 23.15 KB | 0755 |
|
mkcert.sh | File | 879 B | 0755 |
|
old-stats | File | 191.44 KB | 0755 |
|
pop3 | File | 203.55 KB | 0755 |
|
pop3-login | File | 116.42 KB | 0755 |
|
quota-status | File | 728.75 KB | 0755 |
|
rawlog | File | 48.01 KB | 0755 |
|
replicator | File | 153.09 KB | 0755 |
|
script | File | 44.67 KB | 0755 |
|
script-login | File | 37.48 KB | 0755 |
|
stats | File | 310.02 KB | 0755 |
|
submission | File | 117.75 KB | 0755 |
|
submission-login | File | 40.44 KB | 0755 |
|
xml2text | File | 24.09 KB | 0755 |
|