Article 5EJ15 [SOLVED] write variable in a file

[SOLVED] write variable in a file

by
aristosv
from LinuxQuestions.org on (#5EJ15)
When I run this script, the file gets created, but the variable is not passed in the file. How can I render this variable so it's created in the file?

Code:#!/bin/bash

botname=freqtrade1

bash -c 'cat > /etc/systemd/system/$botname.service' << 'EOL'
Description=$botname service
After=network.target
[Service]
ExecStart=/bin/bash -c "cd /root/$botname ; source .env/bin/activate ; freqtrade trade --strategy $botname"
Restart=always
StandardError=append:/var/log/$botname.log
[Install]
WantedBy=multi-user.target
EOLlatest?d=yIl2AUoC8zA latest?i=dDXM1CCgEBA:wMe_ykmGre4:F7zBnMy latest?i=dDXM1CCgEBA:wMe_ykmGre4:V_sGLiP latest?d=qj6IDK7rITs latest?i=dDXM1CCgEBA:wMe_ykmGre4:gIN9vFwdDXM1CCgEBA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments