You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
668 B

2 years ago
#!/bin/bash
# Author: Nils Gerstner
#------------- V A R I A B L E S -------------#
LOGFILE="./update.log"
PID=$$
pipe=/tmp/out_pipe-$PID
err_pipe=/tmp/err_pipe-$PID
#--------- G R A C E F U L E X I T ---------#
trap "rm -f $pipe $err_pipe; pkill -P $PID;" EXIT
#---------- S T A R T L O G G E R ----------#
# Start logging script
./logger.sh $pipe $err_pipe |tee -a ./update.log &
# Make sure named pipes have been created
count=0
until [[ -p $pipe ]] || [[ -p $err_pipe ]]; do
((count++))
if [ $count -gt 100 ]; then break; fi
sleep 0.001
done
sleep 1
#------------ R U N S C R I P T ------------#
./writer.sh $pipe $err_pipe
wait
exit 0