Files

43 lines
857 B
Bash
Raw Permalink Normal View History

2024-01-02 15:49:21 +01:00
#!/bin/bash
2024-01-02 17:16:42 +01:00
# usage: file_env VAR
# ie: file_env TOTO__FILE
file_env() {
local fileVar="$1"
local var="${fileVar/__FILE/}"
if [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
export "$var"="$val"
unset "$fileVar"
fi
}
for e in $(env); do
2024-01-02 22:54:30 +01:00
var=$(cut -d "=" -f 1 <<< "${e}")
2024-01-02 22:49:18 +01:00
echo "$e, $var" >&2
if [[ "$var" =~ __FILE$ ]] ; then
2024-01-02 22:45:25 +01:00
echo "Processing secret : ${var}" >&2
2024-01-02 17:16:42 +01:00
file_env "$var"
fi
done
2024-01-02 23:43:10 +01:00
envsubst < /etc/sssd/sssd.conf.orig > /etc/sssd/sssd.conf
systemctl start sssd.service
pam-auth-update --enable mkhomedir
2024-01-02 15:49:21 +01:00
#echo -e "BASE ${LDAP_BASE}\nURI ${LDAP_SERVER}" > /etc/nslcd.conf
#for item in passwd shadow group; do
# sed -i "s/^${item}:.*/${item}: files ldap/g" /etc/nsswitch.conf
#done
#/usr/sbin/nslcd
#/usr/sbin/rsyslogd
2024-01-02 17:16:42 +01:00
/usr/sbin/sshd
2024-01-02 15:49:21 +01:00
2024-01-02 15:53:38 +01:00
touch /var/log/auth.log
2024-01-02 15:49:21 +01:00
tail -F /var/log/auth.log