Simplify clightning preStart
This commit is contained in:
parent
08067a68ab
commit
a5e10a82d8
@ -79,12 +79,10 @@ in {
|
|||||||
after = [ "bitcoind.service" ];
|
after = [ "bitcoind.service" ];
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -m 0770 -p ${cfg.dataDir}
|
mkdir -m 0770 -p ${cfg.dataDir}
|
||||||
rm -f ${cfg.dataDir}/config
|
|
||||||
chown 'clightning:clightning' '${cfg.dataDir}'
|
|
||||||
cp ${configFile} ${cfg.dataDir}/config
|
cp ${configFile} ${cfg.dataDir}/config
|
||||||
chown 'clightning:clightning' '${cfg.dataDir}/config'
|
chown -R 'clightning:clightning' '${cfg.dataDir}'
|
||||||
chmod +w ${cfg.dataDir}/config
|
# give group read access to allow using lightning-cli
|
||||||
chmod o-rw ${cfg.dataDir}/config
|
chmod u=rw,g=r,o= ${cfg.dataDir}/config
|
||||||
# The RPC socket has to be removed otherwise we might have stale sockets
|
# The RPC socket has to be removed otherwise we might have stale sockets
|
||||||
rm -f ${cfg.dataDir}/lightning-rpc
|
rm -f ${cfg.dataDir}/lightning-rpc
|
||||||
echo "bitcoin-rpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/config'
|
echo "bitcoin-rpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/config'
|
||||||
|
Loading…
Reference in New Issue
Block a user