zoukankan      html  css  js  c++  java
  • 挂载阿里云盘webdav到本地 一年

    桌面发行版建议使用 GUI 小白羊
    下载 最新版

    Win10操作

    
    1、修改注册表使得WIN同时支持http和https:定位到 
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters
    2、把BasicAuthLevel 值改成2,即同时支持http和https,默认只支持https
    3、服务里打开WebClient,改为自动启动,然后重启服务,然后映射网络驱动器即可
    

    webdav.cmd

    @title webdav
    @echo off
    set /p token=<refresh_token
    aliyundrive-webdav -p 8086 -U "admin" -W "passwd" -w "." -r %token% -I 
    

    Ubuntu操作

    webdav.sh

    #!/usr/bin/env bash
    
    root_dir=$(pwd)/
    cd ${root_dir}
    status=$(ps -ef | grep "aliyundrive-webdav" | grep -vc "grep")
    refresh_token=$(cat ./refresh_token)
    port=8086
    password="zhang123."
    log_flie=./log/aliyundrive_$(date +%m%d%H%M%S).log
    #log_flie=/dev/null 2>&1
    #未运行,后台启动进程。
    if [ ${status} -eq 0 ]
    then
        echo "not run, starting.";
        echo "./aliyundrive-webdav -p ${port} -U admin -W ${password} -w ${root_dir} -r ${refresh_token} -I" >> ${log_flie}
        ./aliyundrive-webdav -p ${port} -U admin -W ${password} -w ${root_dir} -r ${refresh_token} -I >> ${log_flie} &
        exit;
    fi
    
    #已运行,打开文件管理器。
    if [ $# -eq 0 ]
    then
        echo "had run, open nautilus.";
        nautilus "dav://localhost:${port}/";
        exit;
    #已运行,且有参数,终止进程
    else
        echo "had run, killing.";
        pid=$(ps -ef | grep "aliyundrive-webdav" | grep -v "grep" | awk '{print $2}');
        kill ${pid};
        exit;
    fi
    
    
    #   JSON.parse(localStorage.getItem('token')).refresh_token
    #sudo apt install davfs2
    #mkdir ~/alipan
    #sudo mount -t davfs https://localhost:8086 ~/alipan
    

    webdav.desktop

    [Desktop Entry]
    Type=Application
    Name=webdav
    Path=/home/ubuntu/soft/webdav/
    Exec=/home/ubuntu/soft/webdav/webdav.sh %f
    Terminal=false
    StartupNotify=true
    

    如有错漏,欢迎指正!谢绝转载。
  • 相关阅读:
    vim复制
    嵌入式Linux学习(二)
    (Java实现) 洛谷 P1042 乒乓球
    (Java实现) 洛谷 P1042 乒乓球
    (Java实现) 洛谷 P1071 潜伏者
    (Java实现) 洛谷 P1071 潜伏者
    (Java实现) 洛谷 P1025 数的划分
    (Java实现)洛谷 P1093 奖学金
    (Java实现)洛谷 P1093 奖学金
    Java实现 洛谷 P1064 金明的预算方案
  • 原文地址:https://www.cnblogs.com/srczhang/p/15171140.html
Copyright © 2011-2022 走看看