您的位置:首页 > 运维架构 > Linux

脚本实现linux和windows间的通知

2012-08-31 11:56 288 查看
依赖:

    windows下:

        plink: putty包里的一个程序, 用于ssh连接

    linux下:

        ssh, samba服务ok

linux下的shell脚本, notify-fifo:

#!/bin/sh

fifo_file=/tmp/sshfifo-${USER}

if [ ! -p $fifo_file ]; then

        mkfifo $fifo_file

fi

if [ $# -eq 0 ]; then

        echo "foo" > $fifo_file

else

        read < $fifo_file

fi

windows下vbs脚本, wait-notify.vbs:

do

    Set ws = CreateObject("Wscript.Shell")

    ws.run "plink -C -l m00194513 -pw 0 10.141.84.159 notify-fifo bar", 0, true

    dim ret

    ret = msgbox("编译结束. 是否打开log?", 1)

    if ret=1 then

    Set ws = CreateObject("Wscript.Shell")

    ws.run "npp
\\10.141.84.159\m00194513\src\1021100\build_android.log"

    end if

loop
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息