Skip to content
Snippets Groups Projects
Commit 8f59ef9a authored by efer's avatar efer
Browse files

check for rclone/age executable + empty password in rclone.conf

parent eb80ab69
No related branches found
No related tags found
No related merge requests found
......@@ -337,7 +337,7 @@ echo -e "[cleanup]" $G_"OK"$_N
#
RCLONEBIN=$(which rclone)
AGEBIN=$(which age)
if [ $RCLONEBIN ] && [ $AGEBIN ]; then
if [[ $(file $RCLONEBIN|grep '64-bit.*executable') ]] && [[ $(file $AGEBIN|grep '64-bit.*executable') ]]; then
echo -e "\nWriting rclone files..."
RCLONE_DIR="$H/.config/rclone"
pwg() {
......@@ -374,6 +374,12 @@ elif [ -f $RCLONE_DIR/rclone.conf ]; then
grep -Fq "[compbackup]" $RCLONE_DIR/rclone.conf
if [ $? -ne 0 ]; then
rcloneconf
else
emptypass=$(grep -F "[compbackup]" -A4 $RCLONE_DIR/rclone.conf|awk -F "=" 'NR==5,//{print $2}')
if [ -z $emptypass ]; then
echo -e "[rclone config]" $R_"Config is broken and needs to be replaced"$_N
exit 1
fi
fi
else
# If $RCLONE_DIR exists but no config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment