forked from Screenly/Anthias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcec_test.sh
executable file
·44 lines (29 loc) · 1.38 KB
/
cec_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
TMPFILE=/tmp/cec.log
# Clean up old file
rm -f $TMPFILE
read -p "What is the TV brand/make? " -r TV_MAKE
read -p "What is the TV model? " -r TV_MODEL
echo "TV Brand: $TV_MAKE" >> $TMPFILE
echo "TV Model: $TV_MODEL" >> $TMPFILE
echo -e "\n\nStarting diagnostics. This will take a few minutes...\n\n"
apt-get -qq update
apt-get install -yqq cec-utils pastebinit
echo -e "\n\nPerforming CEC 'scan' command:\n\n" >> $TMPFILE
echo 'scan' | cec-client -s -d 1 >> $TMPFILE
echo -e "\n\nPerforming CEC 'pow 0.0.0.0' command:\n\n" >> $TMPFILE
echo 'pow 0.0.0.0' | cec-client -s -d 1 >> $TMPFILE
read -p "Is the TV on right now? " -r TV_STATUS_START
echo "Is the TV on now? $TV_STATUS_START" >> $TMPFILE
echo -e "\n\nPerforming CEC 'standby 0.0.0.0' command:\n\n" >> $TMPFILE
echo 'standby 0.0.0.0' | cec-client -s -d 1 >> $TMPFILE
read -p "Is the TV off right now? " -r TV_STATUS_AFTER_POWER_OFF
echo "Is the TV off now? $TV_STATUS_AFTER_POWER_OFF" >> $TMPFILE
echo -e "\n\nPerforming CEC 'on 0.0.0.0' command:\n\n" >> $TMPFILE
echo 'on 0.0.0.0' | cec-client -s -d 1 >> $TMPFILE
read -p "Is the TV on right now? " -r TV_STATUS_AFTER_POWER_ON
echo "Is the TV on now? $TV_STATUS_AFTER_POWER_ON" >> $TMPFILE
echo -e "\n\nPerforming 'cec-compliance -A' command:\n\n" >> $TMPFILE
cec-compliance -A >> $TMPFILE 2>&1
echo -e "\n\nPlease share this URL with us:"
pastebinit -P -i $TMPFILE 2> /dev/null