-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonet
More file actions
executable file
·35 lines (31 loc) · 1020 Bytes
/
Copy pathmonet
File metadata and controls
executable file
·35 lines (31 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
####################################
# Monet - Monitor de Internet #
# #
# upstream: gnew | date: 2018 #
# email: gnewlinux@gmail.com #
# #
# deps: speedtest-cli #
# licence: GPL3+ #
####################################
DEP=$(dpkg --get-selections | grep speedtest-cli | wc -l)
ARQUIVO="$HOME/status_conexao.csv"
function conexaoTeste(){
echo "Aguarde estou verificando a sua conexão."
echo "Verificando Download - Upload..."
speedtest-cli --csv >> $ARQUIVO
}
if [ $DEP -eq 0 ]; then
echo "Precisamos instalar a dependencia speedtest-cli..."
sleep 2s
sudo apt install speedtest-cli -y
fi
if [ -e $ARQUIVO ]; then
conexaoTeste
echo "Seu arquivo foi atualizado com sucesso: $ARQUIVO"
else
echo "Arquivo de log não encontrado, vamos criar: $ARQUIVO"
speedtest-cli --csv-header > $ARQUIVO
conexaoTeste
echo "Seu arquivo foi criado com sucesso: $ARQUIVO"
fi