使用方法

下载

f=AutoMountFtp_aarch64_debian-stretch.bin
rm -f $f;wget http://down.liumou.site/upload/client/$f;chmod +x $f

程序帮助

gxxc@gxxc-CE3000F:~$ ./AutoMountFtp_aarch64_debian-stretch.bin -h
usage: Ftp Auto Mount [-h] -pd PASSWD -u USER -pt PATH -s SERVER [-port PORT]

version: 2.0

optional arguments:
  -h, --help            show this help message and exit
  -pd PASSWD, --passwd PASSWD
                        设置FTP密码
  -u USER, --user USER  设置FTP用户
  -pt PATH, --path PATH
                        设置FTP挂载的本地目录
  -s SERVER, --server SERVER
                        服务器地址
  -port PORT, --port PORT
                        设置服务器端口, 默认: 21

Demo

./AutoMountFtp_aarch64_debian-stretch.bin -u liumou -pd12345 -port 211 -s 10.5.1.2 -pt /home/gxxc/ftp/

效果

log_file:  /home/gxxc/AutoMountFtp.log
mount | grep /home/gxxc/ftp/ | grep 10.5.1.2
2022-10-27 16:38:25 AutoMountFtp.py  行: 106 函数: start - INFO : 需要挂载
2022-10-27 16:38:25 AutoMountFtp.py  行: 50 函数: ftpstatus - DEBUG : 220 Microsoft FTP Service
2022-10-27 16:38:25 AutoMountFtp.py  行: 92 函数: check_network - INFO : Ftp登录成功
2022-10-27 16:38:25 AutoMountFtp.py  行: 111 函数: start - INFO : 目标网络连接正常
2022-10-27 16:38:25 AutoMountFtp.py  行: 66 函数: create_cmd - DEBUG : curlftpfs -o codepage=utf8 10.5.1.2:211 /home/gxxc/ftp/ -o user=liumou:123456
curlftpfs -o codepage=utf8 10.5.1.2:211 /home/gxxc/ftp/ -o user=liumou:123456
2022-10-27 16:38:25 AutoMountFtp.py  行: 69 函数: create_cmd - INFO : 挂载成功