检测阿里云盘文件是否存在如果存在则避免重复下载,登录

This commit is contained in:
lsy 2024-07-26 19:23:25 +08:00
parent 49199ef77f
commit 90aa5271a6

View File

@ -53,13 +53,18 @@ fi
if [[ ! $aliyun_pick =~ [Nn] ]];then if [[ ! $aliyun_pick =~ [Nn] ]];then
cd "$path" cd "$path"
wget https://github.com/tickstep/aliyunpan/releases/download/v0.3.2/aliyunpan-v0.3.2-linux-amd64.zip -O aliyunpan.zip if [[ ! -d aliyunpan ]];then
unzip aliyunpan.zip wget https://github.com/tickstep/aliyunpan/releases/download/v0.3.2/aliyunpan-v0.3.2-linux-amd64.zip -O aliyunpan.zip
rm aliyunpan.zip unzip aliyunpan.zip
declare tmp_file=$( ls | grep aliyunpan ) rm aliyunpan.zip
mv $tmp_file aliyunpan declare tmp_file=$( ls | grep aliyunpan )
cd aliyunpan mv $tmp_file aliyunpan
./aliyunpan login cd aliyunpan
./aliyunpan login
else
echo "检测到阿里云盘已经存在,请确认是否登录"
./aliyunpan who
fi
fi fi
cat > "${path}/backup.sh" << EOF cat > "${path}/backup.sh" << EOF