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