adding basic skeleton for clightning
This commit is contained in:
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user