diff options
| author | 赵坤 <[email protected]> | 2024-05-28 08:43:09 +0000 |
|---|---|---|
| committer | 赵坤 <[email protected]> | 2024-05-28 08:43:09 +0000 |
| commit | 6ebe53a65b47cc4d38e4338baebe53f5194347e0 (patch) | |
| tree | 53c54770919ac2d49d3efe63c8cb3f37d3d18875 | |
| parent | da93abf9fc040356a19bfd4c4f8db2cffbf716b0 (diff) | |
上传新文件
| -rw-r--r-- | start.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..1ebbae4 --- /dev/null +++ b/start.sh @@ -0,0 +1,25 @@ +#!/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 + 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 + echo "Python3 and related packages have been created." +else + echo "Exist python3 and related packages." +fi + +systemctl disable firewalld.service + +chmod 777 /opt/traffic_replay/*.py + +python3 /opt/traffic_replay/install_trex.py +# python3 /opt/traffic_replay/app.py +gunicorn -c gunicorn.conf.py app:app & |
