Compare commits
No commits in common. "66c165e3796da61fa00f833b49208cd70993c4d4" and "f56b74c0e5196f4ce7b6bf46e582327324ad81bc" have entirely different histories.
66c165e379
...
f56b74c0e5
@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
pipe=/tmp/testpipe
|
|
||||||
|
|
||||||
if [[ ! -p $pipe ]]; then
|
|
||||||
echo "Reader not running"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$1" ]]; then
|
|
||||||
echo "$1" >$pipe
|
|
||||||
else
|
|
||||||
echo "Hello from $$" >$pipe
|
|
||||||
fi
|
|
@ -1,32 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
update_controller_pipe="/tmp/update_controller_pipe"
|
|
||||||
|
|
||||||
init () {
|
|
||||||
trap "rm -f $update_controller_pipe" EXIT
|
|
||||||
|
|
||||||
if [[ ! -p $update_controller_pipe ]]; then
|
|
||||||
mkfifo $update_controller_pipe
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
read_config() {
|
read_config() {
|
||||||
# name der fifo laesst sich ueberschreiben
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_for_trigger() {
|
wait_for_trigger() {
|
||||||
if [[ "$1" -eq -1 ]]; then
|
return 0
|
||||||
# wait for external impulse
|
|
||||||
if read line <$update_controller_pipe; then
|
|
||||||
if [ "$line" == "quit" ] || [ "$line" == "update" ]; then
|
|
||||||
echo "$line"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
sleep ${1}
|
|
||||||
echo "sleep"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_for_apism() {
|
check_for_apism() {
|
||||||
@ -99,15 +78,7 @@ UpdateController() {
|
|||||||
|
|
||||||
# By default (trigger_timeout==-1), UpdateController can only be triggered
|
# By default (trigger_timeout==-1), UpdateController can only be triggered
|
||||||
# from some external source to perform an update.
|
# from some external source to perform an update.
|
||||||
while :
|
while wait_for_trigger $trigger_timeout; do
|
||||||
do
|
|
||||||
request=$(wait_for_trigger $trigger_timeout)
|
|
||||||
if [ ${request} = "quit" ]; then
|
|
||||||
$trigger_reboot = true
|
|
||||||
elif [ ${request} != "update" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if $trigger_reboot; then
|
if $trigger_reboot; then
|
||||||
echo "CRITICAL send message to reboot the PSA"
|
echo "CRITICAL send message to reboot the PSA"
|
||||||
send_reboot_message_to_system_controller
|
send_reboot_message_to_system_controller
|
||||||
|
Loading…
x
Reference in New Issue
Block a user