ypserv/rpc.yppasswdd.env

31 lines
929 B
Bash
Raw Permalink Normal View History

2023-03-30 20:29:30 +00:00
#!/bin/bash
#
# Author: Honza Horak <hhorak@redhat.com>
# Date: 2011/11/25
# Package: ypserv
#
# This script is part of ypserv package.
# We need to pass all environment variables set in /etc/sysconfig/yppasswdd
# to rpc.yppasswdd daemon, but only if they are not empty. However, this
# simple logic is not supported by systemd.
# This script wraps the main binary, prepares YPPASSWDD_ARGS variable
# to include all necessary variables (ETCDIR, PASSWDFILE and SHADOWFILE)
# and passes this variable to daemon.
# The script ensures, that the rpc.yppasswdd arguments are not used in case
# the appropriate environment variables are empty.
if [ "$ETCDIR" ]; then
YPPASSWDD_ARGS="$YPPASSWDD_ARGS -D $ETCDIR"
fi
if [ "$PASSWDFILE" ]; then
YPPASSWDD_ARGS="$YPPASSWDD_ARGS -p $PASSWDFILE"
fi
if [ "$SHADOWFILE" ]; then
YPPASSWDD_ARGS="$YPPASSWDD_ARGS -s $SHADOWFILE"
fi
exec /usr/sbin/rpc.yppasswdd -f $YPPASSWDD_ARGS