#!/bin/sh

set -e

case "$1" in
    configure)
        getent passwd |
        while IFS=: read username x uid gid gecos home shell
        do
                # In oem image, the 1000 used for oem user.
                if [ "$uid" -le 1000 ]; then
                        continue
                fi
                if [ "$username" = root -o "$username" = "nobody" -o ! -d "$home" ]; then
                        continue
                fi
                if [ -L "/usr/share/doc/lenovo-doc-dacey/SE30_Linux_UG_0420.pdf" ]; then
                        sudo -Hu "$username" rm -f /usr/share/doc/lenovo-doc-dacey/SE30_Linux_UG_0420.pdf
                fi
        done
    ;;
esac

#DEBHELPER#

exit 0
