mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-08 17:52:35 +02:00
Refactor: Use heredoc when creating env files and creds/other (#15469)
* Use heredoc * Fixes
This commit is contained in:
+5
-6
@@ -58,12 +58,11 @@ function update_script() {
|
||||
-e 's/^NODE_/APP_/' \
|
||||
-e '/^SERVER_*/d' \
|
||||
-e '/^# API*/,+2d' /opt/patchmon/.env
|
||||
{
|
||||
echo ""
|
||||
echo "SESSION_SECRET=$(openssl rand -hex 64)"
|
||||
echo "AI_ENCRYPTION_KEY=$(openssl rand -hex 64)"
|
||||
echo "AGENT_BINARIES_DIR=/opt/patchmon/agents"
|
||||
} >>/opt/patchmon/.env
|
||||
cat <<EOF >/opt/patchmon/.env
|
||||
SESSION_SECRET=$(openssl rand -hex 64)
|
||||
AI_ENCRYPTION_KEY=$(openssl rand -hex 64)
|
||||
AGENT_BINARIES_DIR=/opt/patchmon/agents
|
||||
EOF
|
||||
sed -i -e '\|Directory|s|/backend||' \
|
||||
-e 's|^ExecStart=.*|ExecStart=/opt/patchmon/patchmon-server|' \
|
||||
-e 's|^Environment=NODE_.*|EnvironmentFile=/opt/patchmon/.env|' \
|
||||
|
||||
+5
-5
@@ -57,11 +57,11 @@ function update_script() {
|
||||
sed -i 's/--workers 4//' /opt/wizarr/start.sh
|
||||
fi
|
||||
if ! grep -qE 'FLASK|WORKERS|VERSION' /opt/wizarr/.env; then
|
||||
{
|
||||
echo "FLASK_ENV=production"
|
||||
echo "GUNICORN_WORKERS=4"
|
||||
echo "APP_VERSION=$(sed 's/^20/v&/' ~/.wizarr)"
|
||||
} >>/opt/wizarr/.env
|
||||
cat <<EOF >/opt/wizarr/.env
|
||||
FLASK_ENV=production
|
||||
GUNICORN_WORKERS=4
|
||||
APP_VERSION=$(sed 's/^20/v&/' ~/.wizarr)
|
||||
EOF
|
||||
else
|
||||
sed -i "s/_VERSION=v.*$/_VERSION=v$(cat ~/.wizarr)/" /opt/wizarr/.env
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user