From b3b6d63545a25154293c9b0e9076312e0cd9f42e Mon Sep 17 00:00:00 2001 From: akanealw Date: Thu, 30 Nov 2023 20:06:32 -0600 Subject: [PATCH] updated scripts and added update script --- wrestic/install-wrestic-local.sh | 3 ++- wrestic/install-wrestic-lxc.sh | 3 ++- wrestic/install-wrestic-sftp.sh | 3 ++- wrestic/update-wrestic.sh | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 wrestic/update-wrestic.sh diff --git a/wrestic/install-wrestic-local.sh b/wrestic/install-wrestic-local.sh index 7bcdbda..19ae66f 100644 --- a/wrestic/install-wrestic-local.sh +++ b/wrestic/install-wrestic-local.sh @@ -14,7 +14,8 @@ if [[ ! -f /home/akanealw/.config/wrestic/wrestic.toml ]] mkdir -pv /home/akanealw/restic/restore mkdir -pv /home/akanealw/scripts mkdir -pv /root/restic/restore - wget -qO /usr/local/bin/wrestic http://192.168.1.50/files/wrestic/wrestic +# wget -qO /usr/local/bin/wrestic http://192.168.1.50/files/wrestic/wrestic + curl -sL $(curl -s https://api.github.com/repos/alvaro17f/wrestic/releases/latest | grep browser_download_url | cut -d '"' -f 4) | sudo tar zxf - -C /usr/bin --overwrite wget -qO /home/akanealw/.config/wrestic/wrestic.toml http://192.168.1.50/files/wrestic/wrestic-local.toml wget -qO /home/akanealw/scripts/wrestic-backup-to-truenas.sh http://192.168.1.50/scripts/wrestic/wrestic-backup-to-truenas-local.sh sed -i "s/changemepls/$HOSTNAME/g" /home/akanealw/.config/wrestic/wrestic.toml diff --git a/wrestic/install-wrestic-lxc.sh b/wrestic/install-wrestic-lxc.sh index b13a59a..c121188 100644 --- a/wrestic/install-wrestic-lxc.sh +++ b/wrestic/install-wrestic-lxc.sh @@ -14,7 +14,8 @@ if [[ ! -f /home/akanealw/.config/wrestic/wrestic.toml ]] mkdir -pv /home/akanealw/restic/restore mkdir -pv /home/akanealw/scripts mkdir -pv /root/restic/restore - wget -qO /usr/local/bin/wrestic http://192.168.1.50/files/wrestic/wrestic +# wget -qO /usr/local/bin/wrestic http://192.168.1.50/files/wrestic/wrestic + curl -sL $(curl -s https://api.github.com/repos/alvaro17f/wrestic/releases/latest | grep browser_download_url | cut -d '"' -f 4) | sudo tar zxf - -C /usr/bin --overwrite wget -qO /home/akanealw/.config/wrestic/wrestic.toml http://192.168.1.50/files/wrestic/wrestic-lxc.toml wget -qO /home/akanealw/scripts/wrestic-backup-to-truenas.sh http://192.168.1.50/scripts/wrestic/wrestic-backup-to-truenas-lxc.sh chown -R akanealw:akanealw /home/akanealw/.config diff --git a/wrestic/install-wrestic-sftp.sh b/wrestic/install-wrestic-sftp.sh index 4ea270b..bbb87a5 100644 --- a/wrestic/install-wrestic-sftp.sh +++ b/wrestic/install-wrestic-sftp.sh @@ -38,7 +38,8 @@ if [[ ! -f /home/akanealw/.config/wrestic/wrestic.toml ]] mkdir -pv /home/akanealw/.config/wrestic mkdir -pv /home/akanealw/restic/restore mkdir -pv /root/restic/restore - wget -qO /usr/local/bin/wrestic http://192.168.1.50/files/wrestic/wrestic +# wget -qO /usr/local/bin/wrestic http://192.168.1.50/files/wrestic/wrestic + curl -sL $(curl -s https://api.github.com/repos/alvaro17f/wrestic/releases/latest | grep browser_download_url | cut -d '"' -f 4) | sudo tar zxf - -C /usr/bin --overwrite wget -qO /home/akanealw/.config/wrestic/wrestic.toml http://192.168.1.50/files/wrestic/wrestic-sftp.toml wget -qO /home/akanealw/scripts/wrestic-backup-to-truenas.sh http://192.168.1.50/scripts/wrestic/wrestic-backup-to-truenas-sftp.sh sed -i "s/changemepls/$HOSTNAME/g" /home/akanealw/.config/wrestic/wrestic.toml diff --git a/wrestic/update-wrestic.sh b/wrestic/update-wrestic.sh new file mode 100644 index 0000000..4ede1c7 --- /dev/null +++ b/wrestic/update-wrestic.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -sL $(curl -s https://api.github.com/repos/alvaro17f/wrestic/releases/latest | grep browser_download_url | cut -d '"' -f 4) | sudo tar zxf - -C /usr/bin --overwrite