码迷,mamicode.com
首页 > 其他好文 > 详细

sms_callback.sh

时间:2015-10-14 17:20:26      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

#!/bin/bash
#用户据单回传短信接口
#DB qtabetae
user="***"
password=""
prot="3306"
hostname=`hostname -i`
db=""

order_no=$1

user_debook_sql="SELECT mobile,CODE FROM sms_verify_code WHERE business_key=‘$order_no‘ AND callback_code=‘OTA_USER_APPLY_DEBOOK‘;"
query_result=`mysql -h${hostname} -u${user} \-P${prot} \-p${password}  ${db} \-e"${user_debook_sql}"`
echo ${query_result}
mobile=`echo ${query_result} | awk ‘BEGIN {FS=" "} {print $3}‘`
code=`echo ${query_result} | awk ‘BEGIN {FS=" "} {print $4}‘`

echo ${mobile}
echo ${code}

#用户取消短信接口
cookie=‘‘
content=‘Content-Type:application/json‘


user_result=`curl --Cookie "$cookie"  --header "$content" "http://******:9019/notifyprovider/api/sms/callback?mobile=$mobile&content=$code&longid=1&optime=1&mc=1"`
echo ${user_result}


sms_callback.sh

标签:

原文地址:http://www.cnblogs.com/sarahyu/p/4877615.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!