fix nodeinfo.sh
This commit is contained in:
parent
95c706b1b0
commit
c61c21e2e1
@ -60,13 +60,14 @@ in {
|
||||
after = [ "clightning.service" "tor.service" ];
|
||||
path = [ pkgs.clightning pkgs.jq pkgs.sudo ];
|
||||
serviceConfig = {
|
||||
ExecStart="${pkgs.bash}/bin/bash ${pkgs.nodeinfo}/bin/nodeinfo";
|
||||
ExecStart="${pkgs.bash}/bin/bash ${pkgs.nodeinfo}/bin/nodeinfo > /var/lib/nodeinfo.nix";
|
||||
User = "root";
|
||||
Type = "simple";
|
||||
RemainAfterExit="yes";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
|
@ -1,15 +1,11 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
OUTFILE=/var/lib/nodeinfo.nix
|
||||
|
||||
printenv
|
||||
BITCOIND_ONION=$(cat /var/lib/tor/onion/bitcoind/hostname)
|
||||
CLIGHTNING_ID=$(sudo -u clightning lightning-cli getinfo | jq -r '.id')
|
||||
CLIGHTNING_ID=$(sudo -u clightning lightning-cli --lightning-dir=/var/lib/clightning getinfo | jq -r '.id')
|
||||
|
||||
rm -f $OUTFILE
|
||||
{
|
||||
echo \{
|
||||
echo " bitcoind_onion = \"$BITCOIND_ONION\";"
|
||||
echo " clightning_id = \"$CLIGHTNING_ID\";"
|
||||
echo \}
|
||||
} > $OUTFILE
|
||||
echo \{
|
||||
echo " bitcoind_onion = \"$BITCOIND_ONION\";"
|
||||
echo " clightning_id = \"$CLIGHTNING_ID\";"
|
||||
echo \}
|
||||
|
Loading…
Reference in New Issue
Block a user