首页 > 编程知识 正文

shell脚本连接sftp自动输入密码,l2tp搭建脚本

时间:2023-05-04 11:14:14 阅读:50384 作者:1794

let客户端=require (ssh2- sftp-client ); constpath=require(path ) (constglob=require ) (glob ) ) let sftp=new Client ); const local path=path.join (_ dirname,' ./dist ' ).replace(//g,'/' ) constremotepath='/data/data 控制台. log (删除静态); returns FTP.rmdir (` $ { remote path } `,true ) ) async )={ console.log (静态成功删除) }; console.log (创建静态js、css、img、fonts文件); await sftp.mkdir(`${remotePath} `,true } awaits FTP.mkdir ` $ { remote path }/static `,true}awaitsftp.mkdir true true ) awaitsftp.mkdir ) ` $ {远程路径}/static/fontic } true ) awaits FTP.mkdir (` $ {远程路径}/static/js css constfileliat=glob.sync ` $ { local path }/* */*.{ js,CSS,png,eot,woff,ttf,html} ` )返回优先级. * 远程路径) returnsftp.fastput ) file,remotefile ) ) ) 65 SFTP.end(} ).catch ) (err STP.end(};

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。