实现windows下共享的目录挂载到linux目录
用途
windows下编写的代码在linux下测试运行实现脚本如下:
#!/bin/bash # 共享目录 src="//192.168.1.77/game" # 挂载目录 dest="/home/zcm/share/game" cmd="mount -t cifs -o rw,username=admin,password=1111,uid=1000,gid=1000,iocharset=cp936,file_mode=0777,dir_mode=0777 $src $dest" if [ `df | grep share | wc -l` -eq 0 ]; then echo "not mounted" echo $cmd $cmd else echo "mounted" echo umount $dest umount $dest fi