1 Commits

Author SHA1 Message Date
056c0b545e Merge pull request 'work' (#1) from work into main
Reviewed-on: #1
2024-11-26 14:27:40 -06:00
2 changed files with 11 additions and 6 deletions

View File

@@ -1,8 +1,14 @@
FROM debian:trixie-slim
FROM debian:bullseye-slim
#
COPY ookla_speedtest_cli.list requirements.txt init.sh /
RUN apt update && apt install curl python3 python3-pip iputils-ping -y && pip3 install -r /requirements.txt --break-system-packages && chmod +x /init.sh && curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash
RUN apt update && apt install speedtest -y && apt clean
COPY ookla_speedtest_cli.list /
RUN apt update && apt install curl -y
RUN curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash
RUN apt install python3 python3-pip iputils-ping speedtest -y
COPY logspeedtest.py /usr/local/bin/
COPY requirements.txt /
COPY init.sh /
RUN chmod +x /init.sh
RUN chmod +x /usr/local/bin/logspeedtest.py
RUN pip3 install -r /requirements.txt
RUN apt clean
CMD ["/init.sh"]

View File

@@ -20,8 +20,7 @@ infdbuser = os.environ["INFLUX_USER"]
infdbpass = os.environ["INFLUX_PASSWORD"]
influxuri = os.environ["INFLUX_URI"]
while(True):
response = sp.getstatusoutput(f"speedtest --accept-license --format=json")[1]
print(response)
response = sp.getstatusoutput(f"speedtest --format=json")[1]
respjson = json.loads(response.split("\n")[1])
print(response)
downspeed = respjson['download']['bandwidth'] * 8 / 1024 / 1024