overleaf/server-ce/bin/rename-env-vars-5-0.sh
Jakob Ackermann 12befda220 Merge pull request #16919 from overleaf/jpa-check-env-vars
[server-ce] add script for checking on old ShareLaTeX env vars

GitOrigin-RevId: a60d6f7648d65c336054795affe91a349aa629cf
2024-02-12 09:03:33 +00:00

18 lines
399 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
FILE=${1:-docker-compose.yml}
if [[ ! -f "$FILE" ]]; then
echo "Expected to find $FILE, are you in the wrong directory?"
exit 2
fi
BACKUP_FILE="$FILE.$(date '+%Y.%m.%d-%H.%M.%S')"
echo "Creating backup file $BACKUP_FILE"
cp "$FILE" "$BACKUP_FILE"
echo "Replacing 'SHARELATEX_' with 'OVERLEAF_' in $FILE"
sed -i "s/SHARELATEX_/OVERLEAF_/g" "$FILE"
echo "Done."