Skip to content
Snippets Groups Projects
Commit ebc8e37f authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

fix replace of fqdn

parent eedd0e15
Branches
No related tags found
1 merge request!122restic: fix replace fqdn in RESTIC_REPOSITORY
......@@ -18,6 +18,7 @@
# 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
# 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 @@
# TODO: for restic with https and auth - remove the host in the path
local _target=$( j_getFullTarget )
echo ${_target} | grep "https.*@" >/dev/null
if [ $? -eq 0 ]; then
_target=$( echo $_target | sed "s#${FQDN}/##" )
if grep "^rest:http.*@" <<< "${_target}" >/dev/null; then
local _regex=${FQDN//\./\\.}
_target=$( echo $_target | sed "s#${_regex}/##" )
fi
export RESTIC_REPOSITORY=$_target
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment