فهرست منبع

update userdata.sh.

xdc 5 سال پیش
والد
کامیت
25f7c0e147
1فایلهای تغییر یافته به همراه33 افزوده شده و 4 حذف شده
  1. 33 4
      userdata.sh

+ 33 - 4
userdata.sh

@@ -9,8 +9,7 @@ chmod +x /root/server
 mkdir -p /mnt/v1
 yum install -y amazon-efs-utils
 
-sudo mount -t efs -o tls fs-24bc1bc1:/ /mnt/v1
-
+sudo mount -t efs -o tls fs-91ac0a74:/ /mnt/v1
 aws configure set default.region cn-northwest-1
 aws logs create-log-group --log-group-name cloudlog
 cp /root/server /mnt/v1
@@ -37,6 +36,7 @@ log_group_name = cloudlog
 
 EOB
 
+
 touch /mnt/v1/reboot.sh
 cat > /mnt/v1/reboot.sh <<EOC
 #!/bin/bash
@@ -45,16 +45,45 @@ do
 check=\`curl --silent --fail --connect-timeout 0.1 localhost:7777 || echo 1\`
 if [ "\$check" == "1" ];then
 echo "chattr Ok OK OK !!!!"
-chattr -i /var/.onlyellow
+#chattr -i /var/.onlyellow
 rm -rf /var/.onlyellow
-/root/server_demo /root/conf.toml
+/mnt/v1/server /mnt/v1/conf.toml
 fi
 sleep 1
 done
 
 EOC
 
+
+
+touch /mnt/v1/refund.sh
+cat > /mnt/v1/refund.sh <<EOC
+#!/bin/bash
+while :
+do
+refund=\`tail -n 300 /mnt/v1/server.log|grep Refund|awk '{print \$6}'|sort|uniq\`
+for id in \$refund
+do
+curl -i -H "Accept:application/json" -X POST -d "{\"user_id\":1101,\"game_id\":123,\"refund_id\":\"\${id}\"}" http://onlyellow.cstor.cn:18888/launch_refund
+done
+sleep 6
+done
+EOC
+
 systemctl restart awslogsd
 chmod -R 777 /mnt/v1
 source /mnt/v1/reboot.sh &
+source /mnt/v1/refund.sh &
 /root/server /root/conf.toml
+
+
+
+
+
+
+
+
+
+
+
+