sndev passthrough to docker and containers
This commit is contained in:
parent
8cddbe74ff
commit
a31d04a095
59
sndev
59
sndev
|
@ -5,17 +5,17 @@ docker__compose() {
|
|||
}
|
||||
|
||||
docker__exec() {
|
||||
exec command docker exec "$@"
|
||||
command docker exec "$@"
|
||||
}
|
||||
|
||||
sndev__docker_stacker_lnd() {
|
||||
docker__exec -u lnd stacker_lnd lncli "$@"
|
||||
}
|
||||
|
||||
sndev__docker_sn_lnd() {
|
||||
docker__sn_lnd() {
|
||||
docker__exec -u lnd sn_lnd lncli "$@"
|
||||
}
|
||||
|
||||
docker__stacker_lnd() {
|
||||
docker__exec -u lnd stacker_lnd lncli "$@"
|
||||
}
|
||||
|
||||
sndev__start() {
|
||||
if [ ! -x "$(command -v docker-compose)" ]; then
|
||||
echo "docker compose is not installed"
|
||||
|
@ -38,6 +38,10 @@ sndev__stop() {
|
|||
docker__compose down
|
||||
}
|
||||
|
||||
sndev__restart() {
|
||||
docker__compose restart
|
||||
}
|
||||
|
||||
sndev__status() {
|
||||
shift
|
||||
docker__compose ps --format 'table {{.Service}}\t{{.State}}\t{{.Status}}\t{{.Ports}}'
|
||||
|
@ -50,12 +54,27 @@ sndev__delete() {
|
|||
|
||||
sndev__fund() {
|
||||
shift
|
||||
sndev__docker_stacker_lnd payinvoice --force "$@"
|
||||
docker__stacker_lnd payinvoice --force "$@"
|
||||
}
|
||||
|
||||
sndev__withdraw() {
|
||||
shift
|
||||
sndev__docker_stacker_lnd addinvoice --amt "$@" | jq -r '.payment_request'
|
||||
docker__stacker_lnd addinvoice --amt "$@" | jq -r '.payment_request'
|
||||
}
|
||||
|
||||
sndev__compose() {
|
||||
shift
|
||||
docker__compose "$@"
|
||||
}
|
||||
|
||||
sndev__sn_lncli() {
|
||||
shift
|
||||
docker__sn_lnd "$@"
|
||||
}
|
||||
|
||||
sndev__stacker_lncli() {
|
||||
shift
|
||||
docker__stacker_lnd "$@"
|
||||
}
|
||||
|
||||
sndev__help() {
|
||||
|
@ -80,13 +99,23 @@ USAGE
|
|||
$ sndev [COMMAND]
|
||||
|
||||
COMMANDS
|
||||
start start env
|
||||
stop stop env
|
||||
status status of env
|
||||
delete delete env
|
||||
fund pay a bolt11 for funding
|
||||
withdraw make a bolt11 for withdrawal
|
||||
help display help for sndev
|
||||
help show help
|
||||
|
||||
env:
|
||||
start start env
|
||||
stop stop env
|
||||
restart restart env
|
||||
status status of env
|
||||
delete delete env
|
||||
|
||||
lnd:
|
||||
fund pay a bolt11 for funding
|
||||
withdraw make a bolt11 for withdrawal
|
||||
|
||||
raw:
|
||||
compose call docker compose directly
|
||||
sn_lncli call lncli on sn_lnd directly
|
||||
stacker_lncli call lncli on stacker_lnd directly
|
||||
"
|
||||
echo "$help"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue