Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License update script, instead of editing #238

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading