Compare commits

..

No commits in common. "c4cd7c80cd094dd05a1619e551ef2138a086d088" and "66c165e3796da61fa00f833b49208cd70993c4d4" have entirely different histories.

2 changed files with 8 additions and 28 deletions

View File

@ -1,5 +0,0 @@
{
"fifo_dir" : "/tmp",
"fifo" : "update_controller_fifo",
"GIT_SSL_NO_VERIFY" : true
}

View File

@ -1,39 +1,24 @@
#!/bin/bash
fifo=""
update_controller_pipe="/tmp/update_controller_pipe"
GIT_SSL_NO_VERIFY=true
init () {
trap "rm -f $update_controller_pipe" EXIT
init_fifo () {
trap rm -f ${fifo} EXIT
if [ $? -eq 0 ]; then
# set trap
if [[ ! -p ${fifo} ]]; then
mkfifo ${fifo}
if [ $? -eq 0 ]; then
# fifo created
return 0
fi
fi
if [[ ! -p $update_controller_pipe ]]; then
mkfifo $update_controller_pipe
fi
return 1
}
read_config() {
fifo_dir=$(cat ${1} | jq -r .fifo_dir)
fifo="${fifo_dir}/$(cat ${1} | jq -r .fifo)"
# name der fifo laesst sich ueberschreiben
return 0
}
if read_config UpdateController.conf; then
echo "fifo=$fifo"
#init_fifo "$fifo"
fi
wait_for_trigger() {
if [[ "$1" -eq -1 ]]; then
# wait for external impulse
if read line <$fifo; then
if read line <$update_controller_pipe; then
if [ "$line" == "quit" ] || [ "$line" == "update" ]; then
echo "$line"
fi
@ -110,7 +95,7 @@ UpdateController() {
local trigger_timeout=-1
# read config parameters
# read_config
read_config
# By default (trigger_timeout==-1), UpdateController can only be triggered
# from some external source to perform an update.