Skip to content

Commit

Permalink
Fix stderr redirection in the patch script
Browse files Browse the repository at this point in the history
Change-Id: Id81c96ec009887411c97c5aec1d0f3ced34f9b87
  • Loading branch information
icarpis committed Feb 8, 2018
1 parent 3957437 commit a0e1e85
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/patch-realsense-ubuntu-xenial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
#Break execution on any error received
set -e

#Locally suppress sterr to avoid raising not relevant messages
exec 3>&2
exec 2> /dev/null
#Locally suppress stderr to avoid raising not relevant messages
exec 2>/dev/null

if [ $(ls /dev/video* | wc -l) -ne 0 ];
then
# Restore stderr
exec 2>&1
echo -e "\e[32m"
read -p "Remove all RealSense cameras attached. Hit any key when ready"
echo -e "\e[0m"
fi
# Restore sterr
exec 2>&3
# Restore stderr
exec 2>&1

#Include usability functions
source ./scripts/patch-utils.sh
Expand Down

0 comments on commit a0e1e85

Please sign in to comment.