File PKGBUILD.install of Package cntlm

# - pre_install: The script is run right before files are extracted. One argument is passed: new package version.

# - post_install: The script is run right after files are extracted. One argument is passed: new package version.
post_install() {
    local SERVICE_USER=cntlm
    local SERVICE_GROUP=nobody

    chmod 0600 /etc/cntlm.conf

    if ! getent passwd "$SERVICE_USER" >/dev/null 2>&1 ; then
        echo -n "Adding system user $SERVICE_USER.."
        if useradd \
                --system \
                --gid "$SERVICE_GROUP" \
                --no-create-home \
                --shell /sbin/nologin \
                $SERVICE_USER
        then
            echo "..done"
            chown "$SERVICE_USER:$SERVICE_GROUP" /etc/cntlm.conf
        else
            echo "..failed!"
        fi
    fi
}

# - pre_upgrade: The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.
# - post_upgrade: The script is run right after files are extracted. Two arguments are passed in the following order: new package version, old package version.
# - pre_remove: The script is run right before files are removed. One argument is passed: old package version.
# - post_remove: The script is run right after files are removed. One argument is passed: old package version.
openSUSE Build Service is sponsored by