mount windows shell

来源:互联网 发布:python3 json 编辑:程序博客网 时间:2024/05/01 22:34
#!/bin/kshmy_windows="135.251.27.34"#first ping my windows  ping -c 1 -W 2 $my_windows >> /dev/null#anthenticated though the ftp if [[ $? -ne 0 ]]then        echo "connect my windows failed,need CSL authentication";        ftp $my_windowsfiping -c 1 -W 2 $my_windows >> /dev/nullif [[ $? -ne 0 ]]then    echo "connect my windows failed";    exit 0;fiecho "have connected my windows ......"#find mount filesmount_files=`echo "$(mount)"|awk '{print $3}'`win_mnt=/mnt/huimingf/coderesult=0;for my_mnt in ${mount_files[@]}do    if [ "$my_mnt" == "$win_mnt" ]    then        result=1;        break;    fidoneif [ $result -eq 1 ]then   echo "$my_mnt have mount "   echo "umounting $my_mnt ......"    ./umount_win.exp   echo "umount $my_mnt successfully"fi    ./mount_win.expexit 0

mount_win.sh