Blame SOURCES/rpc.yppasswdd.env

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