#!/bin/sh

set -e

case "$1" in
    configure)
        getent passwd |
        while IFS=: read username x uid gid gecos home shell
        do
                if [ "$uid" -lt 1000 ]; then
                        continue
                fi
                if [ ! -d "$home" -o "$username" = "root" -o "$username" = "nobody" -o "$username" = "oem" ]; then
                        continue
                fi
                if [ ! -L "$home/ThinkPad_T14s_Gen4_LinuxUserGuide.pdf" ]; then
                        sudo -Hu "$username" cp -P /etc/skel/ThinkPad_T14s_Gen4_LinuxUserGuide.pdf "$home"
                fi
        done
    ;;
esac

#DEBHELPER#

exit 0
