#!/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
                for file in UserGuide_thinkstation_p2_tower_gen_2.html UserGuide_thinkstation_p3_tower_gen_2.html ; do
                        if [ ! -L "$home/$file" ]; then
                                sudo -Hu "$username" cp -P "/etc/skel/$file" "$home/"
                        fi
                done
        done
    ;;
esac

#DEBHELPER#

exit 0
