diff options
| author | zhaokun <[email protected]> | 2024-06-06 10:24:10 +0800 |
|---|---|---|
| committer | zhaokun <[email protected]> | 2024-06-06 10:24:10 +0800 |
| commit | d3656ec9ea8c067cb82aa29812ebd9074e8fe83a (patch) | |
| tree | 68156e5e242a717626e23d0889f68e95307ea5f5 | |
| parent | b17801c732da81660af84d7a26243baf7442d0d1 (diff) | |
modify start logic
| -rw-r--r-- | start.sh | 29 | ||||
| -rw-r--r-- | start_gunicorn.sh | 28 |
2 files changed, 29 insertions, 28 deletions
@@ -1,5 +1,34 @@ #!/bin/sh +# Copy the traffic_replay folder to the virtual machine used to send packets,the paht is /opt. +# Run the command at /opt/traffic_replay: ./start.sh +if [[ "$(command -v python3)" == "" ]]; then + echo "No python3, start to installing." + yum -y update + yum install -y net-tools wget python3-devel python3 python3-pip pciutils bind-utils + pip3 install --no-cache-dir scapy + pip3 install --no-cache-dir PyYAML + pip3 install --no-cache-dir requests + pip3 install --no-cache-dir Flask + pip3 install --no-cache-dir gunicorn + pip3 install --no-cache-dir psutil + pip3 install --no-cache-dir supervisor + echo "Python3 and related packages have been created." +else + echo "Exist python3 and related packages." +fi + +systemctl disable firewalld.service + +cd /opt +git clone [email protected]:chongming/traffic_replay.git +git checkout develop +cd /opt/traffic_replay +find . -type f -name "*.py" -exec chmod 777 {} \; + +python3 /opt/traffic_replay/install_trex.py python3 /opt/traffic_replay/kill_gunicorn.py +# python3 /opt/traffic_replay/kill_start.py +# python3 /opt/traffic_replay/app.py gunicorn -c gunicorn.conf.py app:app & # /usr/local/bin/supervisord -c /opt/traffic_replay/supervisor.conf
\ No newline at end of file diff --git a/start_gunicorn.sh b/start_gunicorn.sh index 7da5964..2a71ee4 100644 --- a/start_gunicorn.sh +++ b/start_gunicorn.sh @@ -1,34 +1,6 @@ #!/bin/sh -# Copy the traffic_replay folder to the virtual machine used to send packets,the paht is /opt. -# Run the command at /opt/traffic_replay: ./start.sh - -if [[ "$(command -v python3)" == "" ]]; then - echo "No python3, start to installing." - yum -y update - yum install -y net-tools wget python3-devel python3 python3-pip pciutils bind-utils - pip3 install --no-cache-dir scapy - pip3 install --no-cache-dir PyYAML - pip3 install --no-cache-dir requests - pip3 install --no-cache-dir Flask - pip3 install --no-cache-dir gunicorn - pip3 install --no-cache-dir psutil - pip3 install --no-cache-dir supervisor - echo "Python3 and related packages have been created." -else - echo "Exist python3 and related packages." -fi - -systemctl disable firewalld.service - -cd /opt -git clone [email protected]:chongming/traffic_replay.git -git checkout develop -cd /opt/traffic_replay -find . -type f -name "*.py" -exec chmod 777 {} \; python3 /opt/traffic_replay/install_trex.py -python3 /opt/traffic_replay/kill_gunicorn.py -# python3 /opt/traffic_replay/kill_start.py # python3 /opt/traffic_replay/app.py gunicorn -c gunicorn.conf.py app:app & # /usr/local/bin/supervisord -c /opt/traffic_replay/supervisor.conf
\ No newline at end of file |
