base_role/files/find_skels_to_update.sh

11 lines
281 B
Bash
Raw Normal View History

2024-01-06 01:38:28 +00:00
#!/bin/bash
filename="$1"
for homedir in /home/*; do
if cmp "/etc/skel/$filename" "$homedir/$filename" &>/dev/null; then
owner_group=$(find $homedir -maxdepth 0 -printf '%u:%g')
echo "$filename:$homedir:${owner_group%:*}:${owner_group#*:}"
fi
done