Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnd-channels-backup-dependencies #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions LND-backup/linuxamd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:stretch-slim as builder

WORKDIR /LND-backup

COPY . /LND-backup

ENTRYPOINT ["lnd-channels-backup-dependencies.sh"]
7 changes: 7 additions & 0 deletions LND-backup/linuxarm32v7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:stretch-slim as builder

WORKDIR /LND-backup

COPY . /LND-backup

ENTRYPOINT ["lnd-channels-backup-dependencies.sh"]
36 changes: 36 additions & 0 deletions LND-backup/lnd-channels-backup-dependencies.sh
Original file line number Diff line number Diff line change
@@ -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