web.api: fix sed syntax and format (#3749)

This commit is contained in:
openoms 2023-04-13 11:05:23 +01:00 committed by GitHub
parent 4f93dee697
commit 3b52569be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ if [ "$1" = "update-config" ]; then
fi
# prepare config update
cd /home/blitzapi/blitz_api
cd /home/blitzapi/blitz_api || exit 1
secret=$(cat ./.env 2>/dev/null | grep "secret=" | cut -d "=" -f2)
cp ./.env_sample ./.env
dateStr=$(date)
@ -96,7 +96,7 @@ if [ "$1" = "update-config" ]; then
echo "# CONFIG Web API Lightning --> CL"
sed -i "s/^ln_node=.*/ln_node=cln_jrpc/g" ./.env
sed -i "s/^cln_jrpc_path=.*/cln_jrpc_path="/mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc"/g" ./.env
sed -i "s#^cln_jrpc_path=.*#cln_jrpc_path=\"/mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc\"#g" ./.env
# make sure cln-grpc is on
# sudo /home/admin/config.scripts/cl-plugin.cln-grpc.sh on mainnet
@ -330,7 +330,7 @@ if [ "$1" = "update-code" ]; then
echo "# Update Web API CODE"
systemctl stop blitzapi
sudo chown -R blitzapi:blitzapi /home/blitzapi/blitz_api
cd /home/blitzapi/blitz_api
cd /home/blitzapi/blitz_api || exit 1
if [ "$currentBranch" == "" ]; then
currentBranch=$(sudo -u blitzapi git rev-parse --abbrev-ref HEAD)
fi