|
@@ -0,0 +1,23 @@
|
|
|
+#!/usr/bin/python3
|
|
|
+import os
|
|
|
+import codecs
|
|
|
+import dataset
|
|
|
+
|
|
|
+
|
|
|
+def proc_file(content):
|
|
|
+ fw=codecs.open('/etc/nginx/six/six.conf','w','utf-8')
|
|
|
+ fw.write(content)
|
|
|
+ fw.close()
|
|
|
+
|
|
|
+db = dataset.connect('mysql://hhh7796hhh:lYmWsu^ujcA1@hhh-v57-cluster.cluster-cmab1ctkglka.ap-northeast-2.rds.amazonaws.com:3306/xoops?charset=utf8mb4')
|
|
|
+
|
|
|
+cursor=db.query('SELECT hdesigner_id FROM xoops._hdesigner where onoff=1; ')
|
|
|
+content=""
|
|
|
+for c in cursor:
|
|
|
+ did=c['hdesigner_id']
|
|
|
+ print(did)
|
|
|
+ content+=" location ^~ /six/"+str(did)+"/ { \n"
|
|
|
+ content+=" alias /var/www/jared-six/"+str(did)+"/; }\n"
|
|
|
+
|
|
|
+
|
|
|
+proc_file(content)
|