diff --git a/LND-backup/linuxamd64.Dockerfile b/LND-backup/linuxamd64.Dockerfile new file mode 100644 index 0000000..b6ac2b2 --- /dev/null +++ b/LND-backup/linuxamd64.Dockerfile @@ -0,0 +1,7 @@ +FROM debian:stretch-slim as builder + +WORKDIR /LND-backup + +COPY . /LND-backup + +ENTRYPOINT ["lnd-channels-backup-dependencies.sh"] diff --git a/LND-backup/linuxarm32v7.Dockerfile b/LND-backup/linuxarm32v7.Dockerfile new file mode 100644 index 0000000..b6ac2b2 --- /dev/null +++ b/LND-backup/linuxarm32v7.Dockerfile @@ -0,0 +1,7 @@ +FROM debian:stretch-slim as builder + +WORKDIR /LND-backup + +COPY . /LND-backup + +ENTRYPOINT ["lnd-channels-backup-dependencies.sh"] diff --git a/LND-backup/lnd-channels-backup-dependencies.sh b/LND-backup/lnd-channels-backup-dependencies.sh new file mode 100755 index 0000000..b621d98 --- /dev/null +++ b/LND-backup/lnd-channels-backup-dependencies.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# run as root +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root." + echo "Use the command 'sudo su -' and try again" + exit 1 +fi + +# generate LND backup ssh key +if [ -f /root/.ssh/lnd_backup ]; then + echo "Key exists" +else + echo "Generating SSH key" + ssh-keygen -o -a 100 -t ed25519 -f /root/.ssh/lnd_backup -N '' +fi + +# check and install rsync and inotify +echo "Checking rsync and inotify..." +for pkgs in rsync inotify-tools; do + if [ $(dpkg -s $pkgs 2>/dev/null | grep -c "ok installed") -eq 1 ]; then + echo "$pkgs is already installed " + else + apt -yy install $pkgs + echo "Successfully installed $pkgs " + fi +done + +# check and install rclone +echo "Checking rclone..." +if command -v rclone 2>/dev/null -eq 1; then + echo "rclone is already installed" +else + curl https://rclone.org/install.sh | bash + echo "Successfully installed rclone" +fi