Skip to content

Commit

Permalink
Merge pull request #238 from TykTechnologies/letz-license-update
Browse files Browse the repository at this point in the history
License update script, instead of editing
  • Loading branch information
davegarvey authored Jan 15, 2024
2 parents 97e04cf + 7e150d5 commit 5889eaa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
.env.bak
.DS_store
.context-data
.bootstrap
Expand Down
26 changes: 26 additions & 0 deletions scripts/update-licence.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Use to update your licence key, instead of editing the file directly
# Usage: run it with the license key as an input
#
# Prompt user for the new license key
#
if [ -z "$1" ]; then
echo "Please provide the new license key as an argument."
exit 1
fi

new_license_key="$1"

# Save copy before the update
cp .env .env.bak

# Update the DASHBOARD_LICENCE in .env with the new license key
sed -e "s/^DASHBOARD_LICENCE=.*$/DASHBOARD_LICENCE=${new_license_key}/" .env > .env.output && mv .env.output .env

# Check if sed command succeeded
if [ $? -eq 0 ]; then
echo "License key updated successfully"
else
echo "Failed to update the license key"
fi

0 comments on commit 5889eaa

Please sign in to comment.