|
@@ -1,16 +1,15 @@
|
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
sleep 5
|
|
sleep 5
|
|
|
-wget -O /root/server http://a.xclouds.cloud/all/html/q1/server_demo
|
|
|
|
|
-wget -O /root/conf.toml http://a.xclouds.cloud/all/html/q1/conf.toml1
|
|
|
|
|
|
|
+#wget -O /root/server http://a.xclouds.cloud/all/html/q1/server_demo
|
|
|
|
|
+#wget -O /root/conf.toml http://a.xclouds.cloud/all/html/q1/conf.toml1
|
|
|
|
|
|
|
|
-chmod +x /root/server
|
|
|
|
|
|
|
+#chmod +x /root/server
|
|
|
mkdir -p /mnt/v1
|
|
mkdir -p /mnt/v1
|
|
|
yum install -y amazon-efs-utils
|
|
yum install -y amazon-efs-utils
|
|
|
|
|
|
|
|
sudo mount -t efs -o tls fs-24bc1bc1:/ /mnt/v1
|
|
sudo mount -t efs -o tls fs-24bc1bc1:/ /mnt/v1
|
|
|
|
|
|
|
|
aws configure set default.region cn-northwest-1
|
|
aws configure set default.region cn-northwest-1
|
|
|
-aws logs create-log-group --log-group-name cloudlog
|
|
|
|
|
|
|
|
|
|
yum install -y awslogs
|
|
yum install -y awslogs
|
|
|
cat > /etc/awslogs/awscli.conf <<EOA
|
|
cat > /etc/awslogs/awscli.conf <<EOA
|
|
@@ -34,22 +33,6 @@ log_group_name = cloudlog
|
|
|
|
|
|
|
|
EOB
|
|
EOB
|
|
|
|
|
|
|
|
-touch /mnt/v1/reboot.sh
|
|
|
|
|
-cat > /mnt/v1/reboot.sh <<EOC
|
|
|
|
|
-#!/bin/bash
|
|
|
|
|
-while :
|
|
|
|
|
-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
|
|
|
|
|
- rm -rf /var/.onlyellow
|
|
|
|
|
- /root/server_demo /root/conf.toml
|
|
|
|
|
-fi
|
|
|
|
|
-sleep 0.5
|
|
|
|
|
-done
|
|
|
|
|
-
|
|
|
|
|
-EOC
|
|
|
|
|
source /mnt/v1/reboot.sh &
|
|
source /mnt/v1/reboot.sh &
|
|
|
systemctl restart awslogsd
|
|
systemctl restart awslogsd
|
|
|
/root/server /root/conf.toml
|
|
/root/server /root/conf.toml
|