add logging for non tty invokation

This commit is contained in:
Matthieu Jolimaitre 2024-11-24 17:22:04 +01:00
parent 35b32eabc0
commit bca6aa5734
2 changed files with 19 additions and 10 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/data/token
/repo
/venv
/output.log

View file

@ -6,6 +6,7 @@ cd "$(dirname "$(realpath "$0")")"
interval="6h"
function run {
while true
do
until ping -c 1 '0.0.0.0' > /dev/null
@ -18,3 +19,10 @@ do
echo " $(date)"
sleep "$interval"
done
}
if [ -t 1 ]
then run
else run >> output.log
fi