Chinaunix
标题:
请各位高手帮忙看下,主程序autossh到另一台机器执行程序,如何退出主程序
[打印本页]
作者:
菜菜_2013
时间:
2013-11-01 16:19
标题:
请各位高手帮忙看下,主程序autossh到另一台机器执行程序,如何退出主程序
主程序autoall.sh里面有这么一句
...
...
...
autossh
root@10.10.89.211
111111 "cd /root && sh a.sh "
...
...
a.sh放在10.10.89.211上,内容如下:
#!/bin/sh
path=***
cd /root
wget $path
if [ "$?" -ne 0 ]
then
exit 1
fi
我想实现,如果wget $path执行错误的话,结束autoall.sh脚本,但是目前看只是结束了a.sh的执行,autoall.sh还在继续,wget $path执行错误后,怎么直接退出autoall.sh呢,哪位高手能帮我解答一下呢,多谢多谢多谢
作者:
菜菜_2013
时间:
2013-11-01 16:20
在线等啊啊啊啊啊
作者:
Shell_HAT
时间:
2013-11-01 16:49
autossh root@10.10.89.211 111111 "cd /root && sh a.sh || exit"
复制代码
试试
作者:
菜菜_2013
时间:
2013-11-01 16:54
好的,谢谢,我试下
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2