#!/bin/sh

# Only run once
[ -n "${POST_UPGRADE_CACHE}" ] && touch "${POST_UPGRADE_CACHE}/`basename $0`"

# Only run if the template is already instantiated
CFG="/etc/gdi-record/gdi-record.local"
[ -e "${CFG}" ] || exit 0

# Fix a missing ‘enabled’ value for GCF. This isn't strictly needed by
# gdi-record itself, but the dependency scanner does want it
ENABLED="`gcs_rwvar gcs_get_varcf2 "enabled" "${CFG}" "gcf"`"
if [ -z "${ENABLED}" ]
then
	echo " * GCF recording is enabled."
	gcs_rwvar gcs_set_varcf2 "enabled" "${CFG}" "true" "gcf"
fi

exit 0
