mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-03-31 06:33:56 -04:00
This commit refactors all the shell scripts to use `#!/usr/bin/env bash` instead of `#!/bin/bash`. This change ensures that the scripts will run with the system's default Bash interpreter, even if it is not located at the standard `/bin/bash` path.
25 lines
749 B
Bash
25 lines
749 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Access the Docker container and run the command
|
|
key=$(docker exec big-bear-financial-freedom php artisan key:generate --show)
|
|
|
|
# Check if the key was successfully retrieved
|
|
if [ -z "$key" ]; then
|
|
echo "Failed to retrieve key."
|
|
exit 1
|
|
fi
|
|
|
|
# File to be modified
|
|
file_path="/var/lib/casaos/apps/big-bear-financial-freedom/docker-compose.yml"
|
|
|
|
# Backup the original file (optional but recommended)
|
|
cp "$file_path" "${file_path}.bak"
|
|
|
|
# Use sed to replace the string
|
|
sed -i "s/base64:1234567890abcdefghijklmnopqrstuvwxyz/${key}/g" "$file_path"
|
|
|
|
# Reload the container with CasaOS CLI
|
|
casaos-cli app-management apply "big-bear-financial-freedom" --file="$file_path"
|
|
|
|
echo "Key replaced and container reloaded successfully."
|