#!/usr/bin/env bash
########################################################################
# SAGE64
########################################################################
if [ -z "$SAGE64" ]; then
# If SAGE64 is unset, set it to "yes" if sage-64.txt exists
# and to "no" otherwise.
if [ -f "$SAGE_LOCAL"/etc/sage-64.txt ]; then
export SAGE64=yes
else
export SAGE64=no
fi
elif [ "$SAGE64" = "yes" ]; then
# If SAGE64 is set to "yes", create sage-64.txt
mkdir -p "$SAGE_LOCAL/etc"
touch "$SAGE_LOCAL"/etc/sage-64.txt
elif [ "$SAGE64" = "no" ]; then
# If SAGE64 is set to "no", remove sage-64.txt
rm -f "$SAGE_LOCAL"/etc/sage-64.txt
else
echo >&2 "The environment variable SAGE64 (=$SAGE64) must be either unset, yes or no."
return 1
fi