syslogize #1

Merged
fauno merged 5 commits from syslogize into antifascista 2022-06-05 23:14:50 +00:00
Showing only changes of commit e38f6a1fe6 - Show all commits

20
syslogize.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
# A wrapper for programs that can't write to syslog. Output and error
# are sent to syslog.
#
# Use LOGGER environment variable to pass options to `logger`. They'll
# probably be system-dependent, so handle with care.
#
# Usage:
#
# LOGGER="-t program" syslogize program -o -p --tions argu ments
#
# daemonize syslogize program
if test $# -eq 0 ; then
grep "^#" $0 | grep -v /bin/sh | sed -re "s/^#\s*//" >&2
exit 1
fi
$@ 2>&1 | logger ${LOGGER}