Update usb-passthrough.sh

clean
This commit is contained in:
tteckster 2023-03-08 19:08:45 -05:00 committed by GitHub
parent 7305fa4f0a
commit 6b10aa922a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,31 +15,6 @@ while true; do
esac esac
done done
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
trap cleanup EXIT
function error_exit() {
trap - ERR
local DEFAULT='Unknown failure occured.'
local REASON="\e[97m${1:-$DEFAULT}\e[39m"
local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
msg "$FLAG $REASON"
exit $EXIT
}
function msg() {
local TEXT="$1"
echo -e "$TEXT"
}
function cleanup() {
popd >/dev/null
rm -rf $TEMP_DIR
}
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null pushd $TEMP_DIR >/dev/null
CHAR_DEVS+=("166:.*") CHAR_DEVS+=("166:.*")