Skip to content
Snippets Groups Projects

restic: fix replace fqdn in RESTIC_REPOSITORY

Merged Hahn Axel (hahn) requested to merge 6725-optimize-restic-backup-params into master
2 files
+ 17
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
# 2022-11-04 ah v1.0 one command for forget and prune; rename hooks
# 2022-11-04 ah v1.0 one command for forget and prune; rename hooks
# 2023-03-20 ah v1.1 use vss for backup on MS Windows
# 2023-03-20 ah v1.1 use vss for backup on MS Windows
# 2024-01-23 ah v1.2 prune uses --max-unused unlimited
# 2024-01-23 ah v1.2 prune uses --max-unused unlimited
 
# 2024-01-31 ah v1.3 fix replace of fqdn
# ================================================================================
# ================================================================================
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
@@ -38,9 +39,9 @@
@@ -38,9 +39,9 @@
# TODO: for restic with https and auth - remove the host in the path
# TODO: for restic with https and auth - remove the host in the path
local _target=$( j_getFullTarget )
local _target=$( j_getFullTarget )
echo ${_target} | grep "https.*@" >/dev/null
if grep "^rest:http.*@" <<< "${_target}" >/dev/null; then
if [ $? -eq 0 ]; then
local _regex=${FQDN//\./\\.}
_target=$( echo $_target | sed "s#${FQDN}/##" )
_target=$( echo $_target | sed "s#${_regex}/##" )
fi
fi
export RESTIC_REPOSITORY=$_target
export RESTIC_REPOSITORY=$_target
Loading