Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
comp-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ITS
comp-backup
Commits
feaf22f5
Commit
feaf22f5
authored
3 weeks ago
by
efer
Browse files
Options
Downloads
Patches
Plain Diff
source profile + check for binaries before rcloneconf use
parent
e5c63094
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
comp-backup-install.sh
+12
-3
12 additions, 3 deletions
comp-backup-install.sh
with
12 additions
and
3 deletions
comp-backup-install.sh
+
12
−
3
View file @
feaf22f5
...
...
@@ -209,10 +209,13 @@ $(echo $PATH | grep -o $BIN_DIR &>/dev/null)
if
[
$?
-ne
0
]
;
then
if
[
$SHELL
==
'/bin/bash'
]
;
then
echo
-e
"
\n
export PATH=
$PATH
:
$BIN_DIR
"
>>
$H
/.bash_profile
source
$H
/.bash_profile
elif
[
$SHELL
==
'/bin/zsh'
]
;
then
echo
-e
"
\n
export PATH=
$PATH
:
$BIN_DIR
"
>>
$H
/.zprofile
source
$H
/.zprofile
else
echo
-e
"
\n
export PATH=
$PATH
:
$BIN_DIR
"
>>
$H
/.profile
source
$H
/.profile
fi
fi
...
...
@@ -332,10 +335,13 @@ echo -e "[cleanup]" $G_"OK"$_N
#
# Rclone config
#
RCLONEBIN
=
$(
which rclone
)
AGEBIN
=
$(
which age
)
if
[
$RCLONEBIN
]
&&
[
$AGEBIN
]
;
then
echo
-e
"
\n
Writing rclone files..."
RCLONE_DIR
=
"
$H
/.config/rclone"
pwg
()
{
head
/dev/urandom |
LC_ALL
=
C
tr
-dc
A-Za-z0-9+
=
/ |
head
-c
16 |
rclone
obscure -
head
/dev/urandom |
LC_ALL
=
C
tr
-dc
A-Za-z0-9+
=
/ |
head
-c
16 |
$RCLONEBIN
obscure -
}
rcloneconf
()
{
P1
=
$(
pwg
)
...
...
@@ -356,7 +362,7 @@ password2 = $P2
EOF
# Only encrypt comp-backup remotes
age
-o
$FILE_DIR
/rclone.conf.age
-r
$ITSAGEPUBLICKEY
$FILE_DIR
/rclone.conf
$AGEBIN
-o
$FILE_DIR
/rclone.conf.age
-r
$ITSAGEPUBLICKEY
$FILE_DIR
/rclone.conf
scp
-i
$SSHKEY
$FILE_DIR
/rclone.conf.age
$RUSER
@
$TARGETNODE
:
$RHOME
/
$SCRIPTNAME
/
$HOST
/ &>/dev/null
rm
-f
$FILE_DIR
/rclone.conf
}
...
...
@@ -374,6 +380,9 @@ else
rcloneconf
fi
echo
-e
"[rclone config]"
$G_
"OK"
$_N
else
echo
-e
"[rclone config]"
$R_
"Problem finding rclone/age"
$_N
fi
#
# Prepare Rclone filter
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment