#!/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}
时间: 2024-11-08 21:40:48