|
|
@@ -60,12 +60,39 @@ while True:
|
|
|
if old == code:
|
|
|
print('NO')
|
|
|
else:
|
|
|
+ os.popen("killall server_ddb")
|
|
|
+ os.system("nohup /server_v1 /conf.toml &")
|
|
|
+
|
|
|
os.popen('killall server_k12')
|
|
|
alter("/conf.toml", "secret_code", code)
|
|
|
os.system('nohup /root/server_k12 /conf.toml &')
|
|
|
print('OK===========')
|
|
|
|
|
|
+import boto3
|
|
|
+import os
|
|
|
+import time
|
|
|
+
|
|
|
+while True:
|
|
|
+ time.sleep(1.5)
|
|
|
+ client = boto3.client('dynamodb')
|
|
|
+ res = client.get_item(TableName='hehe2',Key={'name':{'S':'name'}})
|
|
|
+
|
|
|
+ version = res['Item']['version']['S']
|
|
|
|
|
|
+ if version == "RDS":
|
|
|
+ status = os.popen("pgrep server_rds").readline()
|
|
|
+ if len(status) == 0:
|
|
|
+ os.popen("killall server_ddb")
|
|
|
+ os.system("nohup /mnt/v1/rds/server_rds /mnt/v1/rds/conf.toml &")
|
|
|
+ else:
|
|
|
+ print("rds Pro")
|
|
|
+ elif version == "DYNAMODB":
|
|
|
+ status_2 = os.popen("pgrep server_ddb").readline()
|
|
|
+ if len(status_2) == 0:
|
|
|
+ os.popen("killall server_rds")
|
|
|
+ os.system("nohup /mnt/v1/ddb/server_ddb /mnt/v1/ddb/conf.toml &")
|
|
|
+ else:
|
|
|
+ print("DDDDDB Pro")
|
|
|
|
|
|
|
|
|
|