1
xhat 2015-04-02 17:59:17 +08:00
或许你是想要:
crontab里面执行 /usr/bin/php *.php |
3
ooxxcc 2015-04-02 18:17:42 +08:00 1
这个不是返回值……
RESULT=1111 while [[ $RESULT != "0000" ]]; do RESULT=$(curl xxxxxxxxx) sleep 1 done |
4
jyz19880823 2015-04-02 18:20:05 +08:00
result=`curl http://xxx.com/xx.php -s`
|
5
chinawrj 2015-04-02 18:22:48 +08:00
可以输出到stdout, wget是"-",你看一下help。curl是啥。。
|
6
clanned 2015-04-02 18:25:35 +08:00 2
这个是你要的
https://gist.github.com/xdtianyu/aa339f6003604ef6a72f xxx.sh文件 ---- #/bin/bash URL="http://192.168.5.100/xxx.php" check() { RESULT=$(curl -s http://192.168.5.100/xxx.php) echo $RESULT if [ "$RESULT" -eq "1111" ] ; then echo "again" sleep 1 check elif [ "$RESULT" -eq "0000" ] ; then echo "exit" exit 0 else echo "error" fi } check ---- xxx.php文件模拟 ---- <?php if (rand()%5==0) { echo "1111"; } else { echo "0000"; } ?> |
8
cevincheung 2015-04-02 18:30:29 +08:00 1
如果一定要用脚本的话不如用python了。- -#
|
9
wate 2015-04-03 11:45:09 +08:00
@cevincheung 所言甚是
|