summary refs log tree commit diff
path: root/catsit.in
blob: 6e934f151ce1168ccfedb87804bc279407e44b20 (plain) (blame)
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
#!/bin/sh
set -eu

die() {
	echo "${0}:" "$@" >&2
	exit 1
}

: ${CATSITD_PIPE:='%%RUNDIR%%/catsitd.pipe'}

while getopts 'c:' opt; do
	case "${opt}" in
		(c) CATSITD_PIPE=$OPTARG;;
		(?) exit 1;;
	esac
done
shift $((OPTIND - 1))

if ! [ -p "${CATSITD_PIPE}" ]; then
	die "${CATSITD_PIPE} is not a named pipe"
fi
if ! [ -w "${CATSITD_PIPE}" ]; then
	die "${CATSITD_PIPE} is not writable"
fi

[ $# -lt 1 ] && die 'action required'
[ $# -lt 2 ] && die 'service name required'

action=$(echo "${1}" | tr 'A-Z' 'a-z')
for valid in start stop restart status drop $(kill -l | tr 'A-Z' 'a-z'); do
	[ "${action}" = "${valid}" ] && break
done
if [ "${action}" != "${valid}" ]; then
	die "${action} is not a valid action or signal"
fi

echo "$@" > "${CATSITD_PIPE}"
an>Free orderJune McEnroe Oops 2. 2020-04-26Clean up atom.c and fix base URLsJune McEnroe Base URL should not be URL escaped! 2020-04-26Clean up archive.cJune McEnroe 2020-04-26Add -q to exit non-zero on early exitJune McEnroe 2020-04-26Rearrange some of archive.hJune McEnroe 2020-04-26Free part.parts.ptrJune McEnroe Oops. 2020-04-26Rename part->id to part->contentIDJune McEnroe Disambiguate with messageID. 2020-04-26Iterate through nested multiparts to find content for AtomJune McEnroe Also fixes content for multipart/signed. 2020-04-26Include Cc address in reply mailtosJune McEnroe 2020-04-26Use %R for RFC numbers in STANDARDS sectionJune McEnroe 2020-04-26Add mailto spec to STANDARDSJune McEnroe 2020-04-26Increase space between nav itemsJune McEnroe 2020-04-26Add mailto address for the archiveJune McEnroe 2020-04-26Put dates on new lines in indexJune McEnroe 2020-04-26Include <> around Message-Id in mailto: URLsJune McEnroe 2020-04-26Add link to index on thread pagesJune McEnroe 2020-04-26Fall back to Content-Type name parameter for attachmentsJune McEnroe 2020-04-26Remove margins in article.message headerJune McEnroe 2020-04-26Generate index.atomJune McEnroe 2020-04-26Generate XHTML content in Atom entriesJune McEnroe 2020-04-25Style index pageJune McEnroe 2020-04-25Render index.htmlJune McEnroe 2020-04-25Wrap <summary> replies count in <data>June McEnroe 2020-04-25Accumulate thread envelopes before concatenationJune McEnroe 2020-04-24Free envelope in concatDataJune McEnroe 2020-04-24Use replyTo address in mailto:June McEnroe 2020-04-23Wrap quoted lines in <q>June McEnroe