#!/bin/sh

# This script contains the patch systems cluster-wide accounting tasks
# to be completed when the upgrade is committed.
#
# NOTE: We assume that NDU will be busy with the upgrade and therefore
#       not able to process any further cluster-wide patch system
#       requests until the upgrade is commited and this script has
#       be executed.

LOCKFILE=/ifs/.ifsvar/patch/PATCHDB_LOCK

# if run with 0 arguments, take the lock or block waiting.
# run ourselves again with 1 argument which does the actual
# work under the lock
# The name of the argument really doesn't matter, just the count of them.
case $# in
    0)
        exec lockf $LOCKFILE $0 under-lock
        ;;
    1)
        /usr/sbin/isi_patch_agent -t wipe_registered
        exit $?
        ;;
esac
