forked from georgeglarson/docker-bitmessage-gui
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbitmessage-shell
More file actions
executable file
·21 lines (16 loc) · 855 Bytes
/
bitmessage-shell
File metadata and controls
executable file
·21 lines (16 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# filename: bitmessage
set -euxo pipefail
# open Docker container:
# port 8444 available, sharing local directories for SSH and Bitmessage data
# detatched, interactive, pseudo-tty (-dit)
# record container ID in $DID (Docker ID)
DID=$(docker run -p 8444:8444 -v ~/.config/PyBitmessage/:/root/.config/PyBitmessage -v ~/.config/PyBitmessage/keys/:/root/.ssh/ -dit j0rg3/bitmessage-gui bash)
# find IP address of new container, record in $DIP (Docker IP)
DIP=$(docker inspect $DID | grep IPAddress | cut -d '"' -f 4)
# pause for one second to allow container's SSHD to come online
sleep 1
# SSH into container and execute Bitmessage
ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oIdentityFile=~/.config/PyBitmessage/keys/docker-bitmessage-keys -X $DIP
# close container if Bitmessage is closed
docker kill $DID