fix: unable to validate encrypted rclone config file
This commit is contained in:
+8
-9
@@ -33,15 +33,6 @@ function color() {
|
||||
# success strategy (all / any)
|
||||
########################################
|
||||
function check_rclone_connection() {
|
||||
# check if the configuration exists
|
||||
local RCLONE_CONFIG_FILE=$(rclone config file 2>&1 | grep -o '/[^[:space:]]*rclone\.conf')
|
||||
grep -c "\[${RCLONE_REMOTE_NAME}\]" "${RCLONE_CONFIG_FILE}" > /dev/null 2>&1
|
||||
if [[ $? != 0 ]]; then
|
||||
color red "rclone configuration information not found"
|
||||
color blue "Please configure rclone first, check https://github.com/ttionya/vaultwarden-backup/blob/master/README.md#backup"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check flags validity
|
||||
rclone ${RCLONE_GLOBAL_FLAG} version > /dev/null 2>&1
|
||||
if [[ $? != 0 ]]; then
|
||||
@@ -50,6 +41,14 @@ function check_rclone_connection() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if the configuration exists
|
||||
rclone ${RCLONE_GLOBAL_FLAG} config show 2>&1 | grep "\[${RCLONE_REMOTE_NAME}\]" > /dev/null
|
||||
if [[ $? != 0 ]]; then
|
||||
color red "rclone configuration information not found"
|
||||
color blue "Please configure rclone first, check https://github.com/ttionya/vaultwarden-backup/blob/master/README.md#backup"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check connection
|
||||
local ERROR_COUNT=0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user