adding basic skeleton for clightning

This commit is contained in:
b0xxer
2024-02-13 12:27:33 -06:00
parent d83de2ce60
commit ca4bb66680
3 changed files with 85 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#! /bin/sh
#
# entrypoint.sh
# Copyright (C) 2024 barry <barry@a9.local>
#
# Distributed under terms of the MIT license.
#
#!/bin/sh
set -e
# give bitcoind a second to bootup
sleep 1
# containers on linux share file permissions with hosts.
# assigning the same uid/gid from the host user
# ensures that the files can be read/write from both sides
if ! id clightning > /dev/null 2>&1; then
USERID=${USERID:-1000}
GROUPID=${GROUPID:-1000}
echo "adding user clightning ($USERID:$GROUPID)"
groupadd -f -g $GROUPID clightning
useradd -r -u $USERID -g $GROUPID clightning
# ensure correct ownership of user home dir
mkdir -p /home/clightning
chown -R $USERID:$GROUPID /home/clightning
fi
if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for lightningd"
set -- lightningd "$@"
fi
echo "$@"
exec "$@"