diff options
Diffstat (limited to 'xpp/utils/xpp_fxloader')
-rw-r--r-- | xpp/utils/xpp_fxloader | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xpp/utils/xpp_fxloader b/xpp/utils/xpp_fxloader index 1cbd6b7..5a26560 100644 --- a/xpp/utils/xpp_fxloader +++ b/xpp/utils/xpp_fxloader @@ -56,6 +56,8 @@ me=`basename $0` DEBIAN_DEFAULTS="/etc/default/zaptel" REDHAT_DEFAULTS="/etc/sysconfig/zaptel" +status_fd=3 + if [ -r "$DEBIAN_DEFAULTS" -a -r "$REDHAT_DEFAULTS" ]; then echo 1>&2 "$0: Both '$DEBIAN_DEFAULTS' and '$REDHAT_DEFAULTS' exist" exit 1 @@ -143,9 +145,12 @@ load_fpga() { $LOGGER "FPGA Firmware into $dev" sleep_if_race - $FPGA_LOAD -D "$dev" -I "$FIRMWARE_DIR/$fw" -i | $LOGGER - status=$PIPESTATUS - if [ $status != 0 ]; then + ( + $FPGA_LOAD -D "$dev" -I "$FIRMWARE_DIR/$fw" -i + echo $? >$status_fd + )>| $LOGGER + status=`cat <$status_fd` + if [ "$status" != 0 ]; then echo "fpga_load failed with status $status" | $LOGGER exit 77 fi |