1#!/bin/bash 2# SPDX-License-Identifier: GPL-2.0 3 4GREEN='\033[0;92m' 5RED='\033[0;31m' 6NC='\033[0m' # No Color 7 8modprobe rc-loopback 9 10for i in /sys/class/rc/rc* 11do 12 if grep -q DRV_NAME=rc-loopback $i/uevent 13 then 14 LIRCDEV=$(grep DEVNAME= $i/lirc*/uevent | sed sQDEVNAME=Q/dev/Q) 15 fi 16done 17 18if [ -n $LIRCDEV ]; 19then 20 TYPE=lirc_mode2 21 ./test_lirc_mode2_user $LIRCDEV 22 ret=$? 23 if [ $ret -ne 0 ]; then 24 echo -e ${RED}"FAIL: $TYPE"${NC} 25 else 26 echo -e ${GREEN}"PASS: $TYPE"${NC} 27 fi 28fi 29