add logging for non tty invokation
This commit is contained in:
parent
35b32eabc0
commit
bca6aa5734
2 changed files with 19 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
/data/token
|
||||
/repo
|
||||
/venv
|
||||
/output.log
|
||||
|
|
14
run-loop
14
run-loop
|
@ -6,8 +6,9 @@ cd "$(dirname "$(realpath "$0")")"
|
|||
interval="6h"
|
||||
|
||||
|
||||
while true
|
||||
do
|
||||
function run {
|
||||
while true
|
||||
do
|
||||
until ping -c 1 '0.0.0.0' > /dev/null
|
||||
do echo "[run-loop] waiting for internet connection."
|
||||
done
|
||||
|
@ -17,4 +18,11 @@ do
|
|||
echo "[run-loop] Waiting $interval from"
|
||||
echo " $(date)"
|
||||
sleep "$interval"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
if [ -t 1 ]
|
||||
then run
|
||||
else run >> output.log
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue