Fix a few things I missed to ensure zt_chan_conf structure is not modified in mkintf
[asterisk-bristuff.git] / contrib / scripts / autosupport
blob83efef42ae5077a5ae4dce755ff93268c86fd6cc
1 #!/bin/sh
3 # Collect support information
5 # Copyright (C) 2005, Digium, Inc.
7 # Written by John Bigelow (support@digium.com)
9 # Distributed under the terms of the GNU General Public
10 # License
13 OUTPUT=$HOME/digiuminfo
15 MYUID=$(id -u);
17 if [ $MYUID -ne 0 ]; then
19 echo "You must be root to run this."
20 exit 1
23 clear
25 echo
26 echo "This will gather information about your system such as:"
27 echo "pci listing, dmesg, running processes, and kernel version"
28 echo "This may take up to half a minute to run. Please be patient."
29 echo "To continue press 'y', to quit press any other key"
30 read ans
32 if [ "$ans" = "y" ]; then
34 rm -f $OUTPUT
36 echo "------------------" >> $OUTPUT;
37 echo "PCI LIST" >> $OUTPUT;
38 echo "------------------" >> $OUTPUT;
39 lspci -vvvb >> $OUTPUT;
40 echo >> $OUTPUT;
41 echo >> $OUTPUT;
43 echo "------------------" >> $OUTPUT;
44 echo "PCI LIST(no lookup)" >> $OUTPUT;
45 echo "------------------" >> $OUTPUT;
46 lspci -vvvbn >> $OUTPUT;
47 echo >> $OUTPUT;
48 echo >> $OUTPUT;
50 echo "------------------" >> $OUTPUT;
51 echo "INTERRUPTS" >> $OUTPUT;
52 echo "------------------" >> $OUTPUT;
53 cat /proc/interrupts >> $OUTPUT;
54 echo >> $OUTPUT;
55 echo >> $OUTPUT;
57 echo "------------------" >> $OUTPUT;
58 echo "RUNNING PROCESSES" >> $OUTPUT;
59 echo "------------------" >> $OUTPUT;
60 ps aux >> $OUTPUT;
61 echo >> $OUTPUT;
62 echo >> $OUTPUT;
64 echo "------------------" >> $OUTPUT;
65 echo "KERNEL VERSION" >> $OUTPUT;
66 echo "------------------" >> $OUTPUT;
67 uname -a >> $OUTPUT;
68 echo >> $OUTPUT;
69 echo >> $OUTPUT;
71 echo "------------------" >> $OUTPUT;
72 echo "CPU INFO" >> $OUTPUT;
73 echo "------------------" >> $OUTPUT;
74 cat /proc/cpuinfo >> $OUTPUT;
75 echo >> $OUTPUT;
76 echo >> $OUTPUT;
78 echo "------------------" >> $OUTPUT;
79 echo "VERSION INFO" >> $OUTPUT;
80 echo "------------------" >> $OUTPUT;
81 cat /proc/version >> $OUTPUT;
82 echo >> $OUTPUT;
83 echo >> $OUTPUT;
85 echo "------------------" >> $OUTPUT;
86 echo "CMDLINE INFO" >> $OUTPUT;
87 echo "------------------" >> $OUTPUT;
88 cat /proc/cmdline >> $OUTPUT;
89 echo >> $OUTPUT;
90 echo >> $OUTPUT;
92 echo "------------------" >> $OUTPUT;
93 echo "KERNEL CONFIG" >> $OUTPUT;
94 echo "------------------" >> $OUTPUT;
95 echo "/lib/modules/$(uname -r)/build/.config:" >> $OUTPUT;
96 cat /lib/modules/$(uname -r)/build/.config >> $OUTPUT;
97 echo >> $OUTPUT;
98 echo "/usr/src/linux/.config:" >> $OUTPUT;
99 cat /usr/src/linux/.config >> $OUTPUT;
100 echo >> $OUTPUT;
101 echo >> $OUTPUT;
103 echo "------------------" >> $OUTPUT;
104 echo "ZAPTEL MODULE INFO" >> $OUTPUT;
105 echo "------------------" >> $OUTPUT;
106 modinfo /lib/modules/$(uname -r)/misc/*.ko >> $OUTPUT;
107 echo >> $OUTPUT;
108 echo >> $OUTPUT;
110 echo "------------------" >> $OUTPUT;
111 echo "OTHER INFO" >> $OUTPUT;
112 echo "------------------" >> $OUTPUT;
113 echo "/etc/*issues*:" >> $OUTPUT;
114 cat /etc/*issues* >> $OUTPUT;
115 echo >> $OUTPUT;
116 echo "/etc/*release*:" >> $OUTPUT;
117 cat /etc/*release* >> $OUTPUT;
118 echo >> $OUTPUT;
119 echo "/etc/*motd*:" >> $OUTPUT;
120 cat /etc/*motd* >> $OUTPUT;
121 echo >> $OUTPUT;
122 echo >> $OUTPUT;
124 echo "------------------" >> $OUTPUT;
125 echo "LOADED MODULES" >> $OUTPUT;
126 echo "------------------" >> $OUTPUT;
127 lsmod >> $OUTPUT;
128 echo >> $OUTPUT;
129 echo >> $OUTPUT;
131 echo "------------------" >> $OUTPUT;
132 echo "ZTTEST" >> $OUTPUT;
133 echo "------------------" >> $OUTPUT;
134 zttest -c 20 >> $OUTPUT;
135 echo >> $OUTPUT;
136 echo >> $OUTPUT;
138 echo "------------------" >> $OUTPUT;
139 echo "DMESG OUTPUT" >> $OUTPUT;
140 echo "------------------" >> $OUTPUT;
141 dmesg >> $OUTPUT;
142 echo >> $OUTPUT;
143 echo >> $OUTPUT;
145 echo "------------------" >> $OUTPUT;
146 echo "DMIDECODE" >> $OUTPUT;
147 echo "------------------" >> $OUTPUT;
148 dmidecode >> $OUTPUT;
149 echo >> $OUTPUT;
150 echo >> $OUTPUT;
152 echo "------------------" >> $OUTPUT;
153 echo "ZAPTEL CONFIG" >> $OUTPUT;
154 echo "------------------" >> $OUTPUT;
155 grep -v '^#' /etc/zaptel.conf >> $OUTPUT;
156 echo >> $OUTPUT;
157 echo >> $OUTPUT;
159 echo "------------------" >> $OUTPUT;
160 echo "ZAPATA CONFIG" >> $OUTPUT;
161 echo "------------------" >> $OUTPUT;
162 grep -v '^;' /etc/asterisk/zapata.conf >> $OUTPUT;
163 echo >> $OUTPUT;
164 echo >> $OUTPUT;
166 echo "------------------" >> $OUTPUT;
167 echo "EXTENSIONS CONFIG" >> $OUTPUT;
168 echo "------------------" >> $OUTPUT;
169 grep -v '^;' /etc/asterisk/extensions.conf >> $OUTPUT;
170 echo >> $OUTPUT;
171 echo >> $OUTPUT;
173 else
174 echo "terminated";
175 exit
178 clear
180 echo
181 echo "Digium may require root level access to the system to help debug";
182 echo "the problem you are experiencing. Do you want to provide login";
183 echo "information at this time? Please note that if you do so, change";
184 echo "your root password to a secure temporary password for Digium support";
185 echo "Press 'y' for yes and any other key to exit and save the previous info collected"
186 read login
188 if [ "$login" = "y" ]; then
190 echo "------------------" >> $OUTPUT;
191 echo "LOGIN INFORMATION" >> $OUTPUT;
192 echo "------------------" >> $OUTPUT;
194 echo
195 echo "What is your root password?"
196 read rootpass
198 echo
199 echo "Root pass: "$rootpass >> $OUTPUT
201 echo
202 echo "What is your PUBLIC IP address?"
203 read ip
205 echo "IP address: "$ip >> $OUTPUT
207 echo
208 echo "Please provide any other login information that the technician"
209 echo "may need to know to login to the system'(press enter if not)'"
210 read adinfo
212 echo "Additional login info: "$adinfo >> $OUTPUT
214 clear
215 echo
216 echo "All information has been stored in $OUTPUT,"
217 echo "Please attach this file to an email case you already"
218 echo "have open with Digium Tech Support."
220 else
221 clear
222 echo
223 echo "All information except login info has been stored in $OUTPUT,"
224 echo "Please send this file to an email case you already"
225 echo "have open with Digium Tech Support."
226 exit