From 0004d57aa93d7c4d165fdc00c1fd8a478b872054 Mon Sep 17 00:00:00 2001 From: akanealw Date: Wed, 13 Mar 2024 19:53:20 -0500 Subject: [PATCH] testing sed command change --- wrestic/install-wrestic-local.sh | 7 +------ wrestic/install-wrestic-lxc.sh | 1 - wrestic/install-wrestic-sftp.sh | 7 +------ 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/wrestic/install-wrestic-local.sh b/wrestic/install-wrestic-local.sh index 3120b41..036be93 100755 --- a/wrestic/install-wrestic-local.sh +++ b/wrestic/install-wrestic-local.sh @@ -12,15 +12,10 @@ 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 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/local/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 - sed -r 's/(resticbackups)(.*)/\1\L\2\E/g' /home/akanealw/.config/wrestic/wrestic.toml > /home/akanealw/.config/wrestic/wrestic2.toml - mv /home/akanealw/.config/wrestic/wrestic.toml /home/akanealw/.config/wrestic/wresticbackup.toml - mv /home/akanealw/.config/wrestic/wrestic2.toml /home/akanealw/.config/wrestic/wrestic.toml - rm .config/wrestic/wresticbackup.toml + sed -i "s/changemepls/$(cat /etc/hostname | tr '[:upper:]' '[:lower:]')/g" /home/akanealw/.config/wrestic/wrestic.toml chown -R akanealw:akanealw /home/akanealw/.config chown -R akanealw:akanealw /home/akanealw/restic chown -R akanealw:akanealw /home/akanealw/scripts diff --git a/wrestic/install-wrestic-lxc.sh b/wrestic/install-wrestic-lxc.sh index a0224dc..179b9de 100755 --- a/wrestic/install-wrestic-lxc.sh +++ b/wrestic/install-wrestic-lxc.sh @@ -12,7 +12,6 @@ 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 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/local/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 diff --git a/wrestic/install-wrestic-sftp.sh b/wrestic/install-wrestic-sftp.sh index 6a52805..00dd7f1 100755 --- a/wrestic/install-wrestic-sftp.sh +++ b/wrestic/install-wrestic-sftp.sh @@ -36,15 +36,10 @@ 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 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/local/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 -# sed -r 's/(resticbackups)(.*)/\1\L\2\E/g' /home/akanealw/.config/wrestic/wrestic.toml > /home/akanealw/.config/wrestic/wrestic2.toml -# mv /home/akanealw/.config/wrestic/wrestic.toml /home/akanealw/.config/wrestic/wresticbackup.toml -# mv /home/akanealw/.config/wrestic/wrestic2.toml /home/akanealw/.config/wrestic/wrestic.toml -# rm .config/wrestic/wresticbackup.toml + sed -i "s/changemepls/$(cat /etc/hostname | tr '[:upper:]' '[:lower:]')/g" /home/akanealw/.config/wrestic/wrestic.toml chown -R akanealw:akanealw /home/akanealw/.config chown -R akanealw:akanealw /home/akanealw/restic chown -R akanealw:akanealw /home/akanealw/scripts