diff --git a/cron_delete_mp4.sh b/bash/cron_delete_mp4.sh similarity index 100% rename from cron_delete_mp4.sh rename to bash/cron_delete_mp4.sh diff --git a/delete_than.sh b/bash/delete_than.sh similarity index 100% rename from delete_than.sh rename to bash/delete_than.sh diff --git a/push.sh b/bash/git_push.sh similarity index 100% rename from push.sh rename to bash/git_push.sh diff --git a/update.sh b/bash/git_update.sh similarity index 58% rename from update.sh rename to bash/git_update.sh index 2a0b71b..4dcef03 100644 --- a/update.sh +++ b/bash/git_update.sh @@ -3,8 +3,8 @@ set -e # git更新 git pull origin master --force # 配置文件复制到supervisor管理 -cp -r conf/*.conf /etc/supervisor/conf.d/ -cp -r var_conf/push_stream_ + $device_name +cp -r ../conf/common/*.conf /etc/supervisor/conf.d/ +cp -r ../conf/var/$device_name/*.conf /etc/supervisor/conf.d/ # 更新配置文件 supervisorctl reread supervisorctl update diff --git a/record.sh b/bash/record.sh similarity index 100% rename from record.sh rename to bash/record.sh diff --git a/start_data_upload.sh b/bash/start_data_upload.sh similarity index 100% rename from start_data_upload.sh rename to bash/start_data_upload.sh diff --git a/start_push.sh b/bash/start_push_stream.sh similarity index 100% rename from start_push.sh rename to bash/start_push_stream.sh diff --git a/stop_data_upload.sh b/bash/stop_data_upload.sh similarity index 100% rename from stop_data_upload.sh rename to bash/stop_data_upload.sh diff --git a/stop_push.sh b/bash/stop_push_stream.sh similarity index 100% rename from stop_push.sh rename to bash/stop_push_stream.sh diff --git a/bash/test.sh b/bash/test.sh new file mode 100644 index 0000000..9f2ee78 --- /dev/null +++ b/bash/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo $device_name +cp -r ../conf/var/$device_name/*.conf /etc/supervisor/conf.d/ \ No newline at end of file diff --git a/conf/data_upload.conf b/conf/common/data_upload.conf similarity index 100% rename from conf/data_upload.conf rename to conf/common/data_upload.conf diff --git a/conf/mqtt.conf b/conf/common/mqtt.conf similarity index 100% rename from conf/mqtt.conf rename to conf/common/mqtt.conf diff --git a/conf/record.conf b/conf/common/record.conf similarity index 100% rename from conf/record.conf rename to conf/common/record.conf diff --git a/conf/sensor_to_local.conf b/conf/common/sensor_to_local.conf similarity index 100% rename from conf/sensor_to_local.conf rename to conf/common/sensor_to_local.conf diff --git a/conf/sensor_to_server.conf b/conf/common/sensor_to_server.conf similarity index 100% rename from conf/sensor_to_server.conf rename to conf/common/sensor_to_server.conf diff --git a/else_conf/cron.conf b/conf/example/cron.conf similarity index 100% rename from else_conf/cron.conf rename to conf/example/cron.conf diff --git a/else_conf/supervisord.conf b/conf/example/supervisord.conf similarity index 100% rename from else_conf/supervisord.conf rename to conf/example/supervisord.conf diff --git a/var_conf/push_stream_test.conf b/conf/var/test/push_stream.conf similarity index 100% rename from var_conf/push_stream_test.conf rename to conf/var/test/push_stream.conf diff --git a/api.py b/db/api.py similarity index 100% rename from api.py rename to db/api.py diff --git a/ceshi.py b/src/ceshi.py similarity index 87% rename from ceshi.py rename to src/ceshi.py index f0cc69c..8fd7255 100644 --- a/ceshi.py +++ b/src/ceshi.py @@ -1,12 +1,3 @@ -import serial -import time -import struct -import json -import paho.mqtt.client as mqtt - -from api import add -from db.models.log_data_model import LOT_DATA - import subprocess import time import paho.mqtt.client as mqtt diff --git a/create_db.py b/src/create_db.py similarity index 100% rename from create_db.py rename to src/create_db.py diff --git a/sensor_to_local.py b/src/sensor_to_local.py similarity index 99% rename from sensor_to_local.py rename to src/sensor_to_local.py index 8832157..e4aac7d 100644 --- a/sensor_to_local.py +++ b/src/sensor_to_local.py @@ -2,7 +2,7 @@ import time import serial -from api import add +from db.api import add from db.models.log_data_model import LOT_DATA if __name__ == '__main__': diff --git a/sensor_to_server.py b/src/sensor_to_server.py similarity index 99% rename from sensor_to_server.py rename to src/sensor_to_server.py index ce88c75..f618365 100644 --- a/sensor_to_server.py +++ b/src/sensor_to_server.py @@ -5,7 +5,7 @@ import time import serial import paho.mqtt.client as mqtt -from api import add +from db.api import add from db.models.log_data_model import LOT_DATA diff --git a/tool.py b/src/tool.py similarity index 100% rename from tool.py rename to src/tool.py diff --git a/test.sh b/test.sh deleted file mode 100644 index 351453f..0000000 --- a/test.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo $device_name \ No newline at end of file