#!/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 &