-
Notifications
You must be signed in to change notification settings - Fork 72
/
mute_silence.sh
executable file
·107 lines (102 loc) · 3.24 KB
/
mute_silence.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
echo "Toggle the mute/silence switch"
vibrate=$(timelimit -q -t4 idevicesyslog | grep -o "Ringer switch state: on\|Ringer switch state: muted" | wc -l)
if [ ${vibrate} -ge 1 ]; then
echo "Mute/Silence Pass"
else
echo "Mute/Silence Fail"
fi
#
# DIAGNOSTICS=$HOME/The_Drive/bash_profile/dev/logs/OEM/APPLE/DIAGNOSTICS_LOGS
#
# RED='\033[0;31m'
# PURPLE='\033[0;35m'
# YELLOW='\033[1;33m'
# ORANGE='\033[0;33m'
# CYAN='\033[1;36m'
# NC='\033[0m' # No Color
#
# rd_software_version=$(echo "RC-1.1b")
#
#
# time_date=`date +'%a-%h-%d-%Y-%I_%M_%S-%Z'`
#
## pause(){
##
## read -p "The selected process has completed. Press The 'Enter' Key, and select an option." fackEnterKey
## }
#
# space(){
#
# echo ""
#
# }
#
# double_space(){
#
# echo ""
# echo ""
#
# }
#
# udid=$(ideviceinfo -s -k UniqueDeviceID)
#
# ios_power(){
#
# printf "\n${ORANGE}[GET READY] Press Power 2 Times After Count Down${NC}"
# double_space
# sleep_1
#
# # I'm making sure that I control the button presses and the way the diagnostics are run
# # If we allow the users to perform whatever function they want to at anytime, there will be
# # no constant we can follow, and we cannot develop machine learning in the future.
# # The results will be more accurate and precise as well.
#
#
# # I'm doing a 3 second count down for the user to double tap the power
#
# termdown 2
#
#
# printf "\n${CYAN}[ATTENTION] Press Power Button Now ${NC}"
# sleep 1
# printf "\n${CYAN}[ATTENTION] Press Power Button Again${NC}"
#
# timelimit -q -t8 idevicesyslog > ${DIAGNOSTICS}/${udid}/power.log
#
# }
#
# ios_power
#
# ios_power_result(){
#
# # Lock usagePage:0xc usage:0x30 downEvent:0 up
# # Received display status: is_on false
# # Lock button single press recognized
#
# good=$(cat ${DIAGNOSTICS}/${udid}/power.log | grep -o "Lock usagePage:0xc usage:0x30 downEvent:0 up\|Received display status: is_on false\|Lock button single press recognized" | wc -l)
#
# if [[ ${good} -ge 1 ]]; then
#
# printf "\n${PURPLE}[INFO]${NC} Power Button: Full Function"
#
# elif [[ ${good} -eq 0 ]]; then
#
# printf "\n${PURPLE}[INFO]${NC} Power Button: HW Mismatch"
#
# else
#
# printf "\n${ORANGE}[ADVISORY]${NC} Power Button: Functionality Unknown"
#
# fi
#
#
#
# }
#
#
# ios_power_result | tee ${DIAGNOSTICS}/${udid}/power_result.log
# space
#
# # This is the variable going to the database
# ios_power_out_db=$(cat ${DIAGNOSTICS}/${udid}/power_result.log | awk -F 'Button:' '{print $NF}' | xargs)