Compare commits
7 Commits
a1e168f345
...
work
Author | SHA1 | Date | |
---|---|---|---|
ce1c4c36dd | |||
ab6ca7fac6 | |||
96b7f4cbc0 | |||
6616bf7fae | |||
192fc55105 | |||
7948c548e3 | |||
738df45609 |
12
Dockerfile
12
Dockerfile
@@ -1,12 +1,8 @@
|
||||
FROM debian:bullseye-slim
|
||||
FROM debian:trixie-slim
|
||||
#
|
||||
COPY ookla_speedtest_cli.list /etc/apt/sources.list.d/
|
||||
RUN apt update && apt install python3 python3-pip iputils-ping speedtest -y
|
||||
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 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"]
|
@@ -20,7 +20,8 @@ infdbuser = os.environ["INFLUX_USER"]
|
||||
infdbpass = os.environ["INFLUX_PASSWORD"]
|
||||
influxuri = os.environ["INFLUX_URI"]
|
||||
while(True):
|
||||
response = sp.getstatusoutput(f"speedtest --format=json")[1]
|
||||
response = sp.getstatusoutput(f"speedtest --accept-license --format=json")[1]
|
||||
print(response)
|
||||
respjson = json.loads(response.split("\n")[1])
|
||||
print(response)
|
||||
downspeed = respjson['download']['bandwidth'] * 8 / 1024 / 1024
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# this file was generated by packagecloud.io for
|
||||
# this file was generated by packagecloud.io for #
|
||||
# the repository at https://packagecloud.io/ookla/speedtest-cli
|
||||
|
||||
deb [signed-by=/etc/apt/keyrings/ookla_speedtest-cli-archive-keyring.gpg] https://packagecloud.io/ookla/speedtest-cli/debian/ bookworm main
|
||||
|
Reference in New Issue
Block a user