containers-postsrsd/postsrsd.sh

19 lines
458 B
Bash
Raw Normal View History

2020-09-04 13:19:00 +00:00
#!/bin/sh
set -e
2022-03-15 23:03:52 +00:00
export SRS_PID_FILE=/run/postsrsd/postsrsd.pid
2020-09-04 13:19:00 +00:00
2022-03-15 23:03:52 +00:00
case $1 in
start)
test -n "${SRS_DOMAIN}"
test -n "${SRS_SECRET}"
test -f "${SRS_SECRET}" || dd if=/dev/urandom bs=18 count=1 status=none | base64 > "${SRS_SECRET}"
2022-03-15 23:40:38 +00:00
install -dm 750 -o postsrsd -g postsrsd "${SRS_PID_FILE%/*}"
2022-03-15 23:03:52 +00:00
/usr/sbin/postsrsd -e -D -u postsrsd -l ::
;;
2020-09-04 13:19:00 +00:00
stop)
2022-03-15 23:03:52 +00:00
test ! -f "${SRS_PID_FILE}" || cat "${SRS_PID_FILE}" | xargs -r kill
2020-09-04 13:19:00 +00:00
;;
esac