-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialer
executable file
·94 lines (92 loc) · 2.13 KB
/
dialer
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
#!/bin/bash
# http://social.stormdragon.tk/storm
# Released under the terms of the WTFPL: http://wtfpl.net
toneLength=.03 # Length of the tone
toneGap=.01 # Time between tones
pauseLength=1 # Length of pause, represented by a , in the number
set -o noglob
if [ $# -eq 0 ]; then
read -p "Enter phone number containing text: " numberText
else
numberText="$@"
fi
numberText="$(echo "${numberText^^}" | tr -cd "[:alnum:]#*,")"
for i in $(seq 0 ${#numberText}); do
if [ ${#numberText} -eq 11 ]; then
if [ $i -eq 0 ]; then
echo -n "+"
fi
if [ $i -eq 1 ]; then
echo -n " ("
fi
if [ $i -eq 4 ]; then
echo -n ") "
fi
if [ $i -eq 7 ]; then
echo -n "-"
fi
fi
if [ ${#numberText} -eq 10 ]; then
if [ $i -eq 0 ]; then
echo -n "("
fi
if [ $i -eq 3 ]; then
echo -n ") "
fi
if [ $i -eq 6 ]; then
echo -n "-"
fi
fi
if [ ${#numberText} -eq 7 ]; then
if [ $i -eq 3 ]; then
echo -n "-"
fi
fi
echo -n ${numberText:$i:1}|tr A-Z 22233344455566677778889999
case "${numberText:$i:1}" in
\#)
tone="sin 941 sin 1477"
;;
0)
tone="sin 941 sin 1336"
;;
1)
tone="sin 697 sin 1209"
;;
A|B|C|2)
tone="sin 697 sin 1336"
;;
D|E|F|3)
tone="sin 697 sin 1477"
;;
G|H|I|4)
tone="sin 770 sin 1209"
;;
J|K|L|5)
tone="sin 770 sin 1336"
;;
M|N|O|6)
tone="sin 770 sin 1477"
;;
P|Q|R|S|7)
tone="sin 852 sin 1209"
;;
T|U|V|8)
tone="sin 852 sin 1336"
;;
W|X|Y|Z|9)
tone="sin 852 sin 1477"
;;
\*)
tone="sin 941 sin 1209"
;;
",")
sleep $pauseLength
continue
esac
if [ $i -lt ${#numberText} ]; then
play -V0 -qn synth $toneLength $tone pad $toneGap remix -
fi
done
echo
exit 0