Installer create pam entry on ubuntu/debian

This commit is contained in:
Tobias Herre 2025-05-03 12:42:37 +02:00
parent 690e84af24
commit 71b7352d7a
1 changed files with 20 additions and 1 deletions

View File

@ -29,7 +29,6 @@ copy_files() {
cp wmde-rp-generate-known-hosts.sh $PREFIX/
#cp wmde-rp-usersync-nfs.sh $PREFIX/
cp wmde-rp-unison-ssh.sh $PREFIX/
cp wmde-rp-progress.sh $PREFIX/
cp wmde-rp-common.sh $PREFIX/
cp wmde-rp-osync-ssh.sh $PREFIX/
chmod 755 $PREFIX/*
@ -76,6 +75,26 @@ if [ "$OS" = "DEBIAN" ]; then
rm -rf unison_temp
copy_files
FILE="/etc/pam.d/common-session"
LINE="session required pam_exec.so stdout /usr/local/bin/wmde/wmde-rp-init.sh"
FOUND=0
# Datei zeilenweise prüfen
while IFS= read -r existing_line; do
if [ "$existing_line" = "$LINE" ]; then
FOUND=1
break
fi
done < "$FILE"
if [ "$FOUND" -eq 0 ]; then
echo "$LINE" >> "$FILE"
echo "Zeile hinzugefügt."
else
echo "Zeile ist bereits vorhanden."
fi
fi