#!/bin/sh

LOCKFILE=/ifs/.ifsvar/LIC_COMMIT_LK
MIGRATED_FLAG=/ifs/.ifsvar/lic_migration.done
LIC_FROM_VERS=/ifs/.ifsvar/lic_migration_from_version

case $# in
	0)
		exec lockf $LOCKFILE $0 under-lock
		;;
	1)

		if [ -f $LIC_FROM_VERS ]; then
			cat $LIC_FROM_VERS
			echo "Removing" $LIC_FROM_VERS
			rm -f $LIC_FROM_VERS
		fi
		;;
esac

# The purpose of this file: if we complete a elicensed enabled commit,
# this is touched, indicating that we completed a licensing migration and never
# want to do it again... This commit hook will just touch this file
# regardless of OneFS versions.
touch $MIGRATED_FLAG
