2 # Copyright (c) 2004-2015 Apple Inc.
6 # Collect system & network configuration information.
9 PATH
=/bin
:/usr
/bin
:/sbin
:/usr
/sbin
14 cat <<_END_OF_DISCLAIMER
16 This diagnostic tool generates files that allow Apple to investigate issues
17 with your computer and help Apple to improve its products. The generated files
18 may contain some of your personal information, which may include, but not be
19 limited to, the serial number or similar unique number for your device, your
20 user name, or your computer name. The information is used by Apple in
21 accordance with its privacy policy (www.apple.com/privacy) and is not shared
22 with any third party. By enabling this diagnostic tool and sending a copy of
23 the generated files to Apple, you are consenting to Apple's use of the content
28 /bin
/echo "Press 'Enter' to continue."
35 if [ ${EUID} -ne 0 ]; then
39 if [ -x /usr
/bin
/tail ]; then
40 TAIL_2000
="/usr/bin/tail -n 2000"
41 TAIL_25000
="/usr/bin/tail -n 25000"
47 OUT
="mobility-info-`date +'%m.%d.%Y.%H%M%S'`"
49 if [ -d ~
/Desktop
]; then
51 elif [ "`readlink /tmp`" = "private/var/tmp" ]; then
52 OUTDIR
=/Library
/Logs
/CrashReporter
58 WORKDIR
=`mktemp -d -q "/tmp/${OUT}"`
60 echo "Could not create snapshot directory"
66 if [ -x /usr
/bin
/gzip ]; then
71 ARCHIVE
=`mktemp -q "${OUTDIR}/${OUT}.tar${GZ_EXT}"`
73 echo "Could not create snapshot archive"
81 echo "Please wait, collecting information and statistics"
85 # Execute network reachability/DNS commands early
87 echo "#" > reachability
-info
88 echo '# scutil -d -v -r www.apple.com "" no-server' >> reachability
-info
89 echo "#" >> reachability
-info
90 scutil
-d -v -r www.apple.com
"" no
-server >> reachability
-info 2>&1
92 echo "#" >> reachability
-info
93 echo '# scutil -d -v -r 0.0.0.0 no-server' >> reachability
-info
94 echo "#" >> reachability
-info
95 scutil
-d -v -r 0.0.0.0 no
-server >> reachability
-info 2>&1
97 if [ -x /usr
/bin
/dig -a -f /etc
/resolv.conf
]; then
98 /usr
/bin
/dig -t any
-c any www.apple.com
> dig-results 2>/dev
/null
102 # Signal "networkd" and "mDNSResponder" early to log their "state" info. This
103 # logging will continue while we execute a few other commands and should be
104 # complete by the time we collect the log content.
106 if [ -x /usr
/bin
/killall
]; then
108 # request networkd state
110 ${PRIV} /usr
/bin
/killall
-INFO networkd
2>/dev
/null
113 # request mDNSResponder state
115 ${PRIV} /usr
/bin
/killall
-INFO mDNSResponder
2>/dev
/null
123 if [ -x /bin
/ps
]; then
124 /bin
/ps axlww
> ps
2>&1
128 # network interface configuration
130 if [ -x /sbin
/ifconfig
]; then
131 /sbin
/ifconfig
-a -L -b -m -r -v -v > ifconfig
2>&1
132 if [ $?
-ne 0 ]; then
133 /sbin
/ifconfig
-a > ifconfig
2>&1
138 # network route configuration
140 if [ -x /usr
/sbin
/netstat
]; then
141 /usr
/sbin
/netstat
-n -r -a -l > netstat
2>&1
147 if [ -x /sbin
/ifconfig
]; then
148 for if in `/sbin/ifconfig -l`
152 en
* ) ipconfig getpacket
${if} > ipconfig
-${if} 2>&1
161 if [ -x /System
/Library
/PrivateFrameworks
/Apple80211.framework
/Resources
/airport
]; then
162 /System
/Library
/PrivateFrameworks
/Apple80211.framework
/Resources
/airport
--getinfo \
169 if [ -x /usr
/bin
/wdutil
-a -x /bin
/ls ]; then
170 ${PRIV} /usr
/bin
/wdutil dump
172 /bin
/ls -1 /private
/tmp
/wifi
-* 2>/dev
/null \
175 if [ -f "${log}" ]; then
176 b
="`basename ${log}`"
177 ${PRIV} cat "${log}" > "wifi_dump/${b}" 2>&1
185 if [ -e /System
/Library
/CoreServices
/SystemVersion.plist
]; then
186 cat /System
/Library
/CoreServices
/SystemVersion.plist \
187 > SystemVersion.plist
2>&1
193 if [ -x /usr
/sbin
/ioreg
]; then
194 /usr
/sbin
/ioreg
-i -l -w 0 > ioreg
2>&1
195 /usr
/sbin
/ioreg
-i -l -p IODeviceTree
-w 0 >> ioreg
2>&1
199 # Power Management info
201 if [ -x /usr
/bin
/pmset
]; then
203 echo "# pmset -g everything" >> pmset
205 /usr
/bin
/pmset
-g everything
2>/dev
/null
| ${TAIL_25000} >> pmset
211 if [ -x /bin
/hostname
]; then
212 /bin
/hostname
> hostname
2>&1
218 if [ -x /usr
/bin
/hostinfo
]; then
219 /usr
/bin
/hostinfo
> hostinfo
2>&1
221 if [ -e /etc
/hostconfig
]; then
222 cat /etc
/hostconfig
> etc.hostconfig
2>&1
228 scutil
--dns > dns
-configuration 2>&1
229 if [ -e /etc
/resolv.conf
]; then
230 cat /etc
/resolv.conf
> etc.resolv.conf
2>&1
232 if [ -e /var
/run
/resolv.conf
]; then
233 cat /var
/run
/resolv.conf
> var.run.resolv.conf
2>&1
235 if [ -e /etc
/resolver
]; then
236 tar -c -H /etc
/resolver
> etc.resolver.
tar 2>/dev
/null
240 # Proxy configuration
242 scutil
-d -v --proxy > proxy
-configuration 2>&1
245 # Network information
247 if [ -x /sbin
/ifconfig
]; then
248 echo "#" > network
-information
249 echo "# scutil --nwi" >> network
-information
250 echo "#" >> network
-information
251 scutil
--nwi >> network
-information 2>&1
252 for if in `/sbin/ifconfig -l`
254 echo "" >> network
-information
255 echo "#" >> network
-information
256 echo "# scutil --nwi ${if}" >> network
-information
257 echo "#" >> network
-information
258 scutil
--nwi ${if} >> network
-information 2>&1
263 # System / network preferences
266 /Library
/Preferences
/SystemConfiguration
/NetworkInterfaces.plist \
267 /Library
/Preferences
/SystemConfiguration
/com.apple.PowerManagement.plist \
268 /Library
/Preferences
/SystemConfiguration
/com.apple.airport.preferences.plist \
269 /Library
/Preferences
/SystemConfiguration
/com.apple.nat.plist \
270 /Library
/Preferences
/SystemConfiguration
/com.apple.smb.server.plist \
271 /Library
/Preferences
/SystemConfiguration
/com.apple.wifi.plist \
272 /Library
/Preferences
/SystemConfiguration
/preferences.plist \
273 /Library
/Preferences
/com.apple.alf.plist \
274 /Library
/Preferences
/com.apple.sharing.firewall.plist \
275 /Library
/Preferences
/com.apple.networkextension.plist \
276 /Library
/Preferences
/com.apple.networkextension.control.plist \
277 /Library
/Preferences
/com.apple.networkextension.necp.plist \
278 /Library
/Preferences
/com.apple.wwand.plist \
281 if [ -e "${f}" ]; then
283 cat "${f}" > "${b}" 2>&1
288 # System / network preferences (from other volumes)
290 /bin
/ls /Volumes
2>/dev
/null \
293 V_PATH
="/Volumes/${volume}"
294 if [ -h "${V_PATH}" ]; then
295 # if the path is a symlink
299 /Library
/Preferences
/SystemConfiguration
/Networkinterfaces.plist \
300 /Library
/Preferences
/SystemConfiguration
/preferences.plist \
303 if [ -f "${V_PATH}/${f}" ]; then
304 mkdir -p "OtherPreferences/${volume}"
306 cat "${V_PATH}/${f}" > "OtherPreferences/${volume}/${b}" 2>&1
314 if [ -e /etc
/bootpd.plist
]; then
315 cat /etc
/bootpd.plist
> bootpd.plist
2>&1
316 cat /etc
/com.apple.named.proxy.conf
> com.apple.named.proxy.conf
2>/dev
/null
317 elif [ -e /Library
/Preferences
/SystemConfiguration
/bootpd.plist
]; then
318 cat /Library
/Preferences
/SystemConfiguration
/bootpd.plist
> bootpd.plist
2>&1
319 cat /Library
/Preferences
/SystemConfiguration
/com.apple.named.proxy.conf
> com.apple.named.proxy.conf
2>/dev
/null
325 ${PRIV} scutil
-p --snapshot
326 if [ -f /var
/tmp
/configd
-store.plist
]; then
327 cat /var
/tmp
/configd
-store.plist
> configd
-store.plist
2>&1
329 if [ -f /var
/tmp
/configd
-pattern.plist
]; then
330 cat /var
/tmp
/configd
-pattern.plist
> configd
-pattern.plist
2>&1
332 if [ -f /var
/tmp
/configd
-session.plist
]; then
333 cat /var
/tmp
/configd
-session.plist
> configd
-session.plist
2>&1
335 if [ -f /var
/tmp
/configd
-state ]; then
336 cat /var
/tmp
/configd
-state > configd
-state 2>&1
338 if [ -f /var
/tmp
/configd
-reachability ]; then
339 cat /var
/tmp
/configd
-reachability > configd
-reachability 2>&1
343 # mounted filesystems
345 mount
> mounted
-filesystems 2>&1
347 ${PRIV} cat /etc
/hosts
> etc.hosts
2>/dev
/null
350 # kernel extensions statistic
352 if [ -x /usr
/sbin
/kextstat
]; then
353 /usr
/sbin
/kextstat
> kextstat
2>&1
359 /bin
/echo -n "" > network
-statistics
361 if [ -x /usr
/sbin
/arp
]; then
362 echo "#" >> network
-statistics
363 echo "# arp -n -a" >> network
-statistics
364 echo "#" >> network
-statistics
365 /usr
/sbin
/arp
-n -a >> network
-statistics 2>&1
368 if [ -x /usr
/sbin
/netstat
]; then
369 echo "#" >> network
-statistics
370 echo "# netstat -A -a -l -n" >> network
-statistics
371 echo "#" >> network
-statistics
372 /usr
/sbin
/netstat
-A -a -l -n >> network
-statistics 2>&1
374 echo "#" >> network
-statistics
375 echo "# netstat -s" >> network
-statistics
376 echo "#" >> network
-statistics
377 /usr
/sbin
/netstat
-s >> network
-statistics 2>&1
379 echo "#" >> network
-statistics
380 echo "# netstat -mmm" >> network
-statistics
381 echo "#" >> network
-statistics
382 /usr
/sbin
/netstat
-mmm >> network
-statistics 2>&1
384 echo "#" >> network
-statistics
385 echo "# netstat -i -n -d" >> network
-statistics
386 echo "#" >> network
-statistics
387 /usr
/sbin
/netstat
-i -n -d >> network
-statistics 2>&1
389 echo "#" >> network
-statistics
390 echo "# netstat -g -n -s" >> network
-statistics
391 echo "#" >> network
-statistics
392 /usr
/sbin
/netstat
-g -n -s >> network
-statistics 2>&1
394 echo "#" >> network
-statistics
395 echo "# netstat -i -x R" >> network
-statistics
396 echo "#" >> network
-statistics
397 /usr
/sbin
/netstat
-i -x R
>> network
-statistics 2>&1
398 echo "#" >> network
-statistics
400 echo "# netstat -a -n -p mptcp" >> network
-statistics
401 echo "#" >> network
-statistics
402 /usr
/sbin
/netstat
-a -n -p mptcp
>> network
-statistics 2>/dev
/null
404 echo "#" >> network
-statistics
405 echo "# netstat -s -p mptcp" >> network
-statistics
406 echo "#" >> network
-statistics
407 /usr
/sbin
/netstat
-s -p mptcp
>> network
-statistics 2>/dev
/null
409 if [ -x /sbin
/ifconfig
]; then
410 for if in `/sbin/ifconfig -l`
412 `/sbin/ifconfig -v ${if} | grep -q TXSTART`
413 if [ $?
-eq 0 ]; then
414 echo "#" >> network
-statistics
415 echo "# netstat -qq -I ${if}" >> network
-statistics
416 echo "#" >> network
-statistics
417 /usr
/sbin
/netstat
-qq -I ${if} >> network
-statistics 2>&1
419 `/sbin/ifconfig -v ${if} | grep -q RXPOLL`
420 if [ $?
-eq 0 ]; then
421 echo "#" >> network
-statistics
422 echo "# netstat -Q -I ${if}" >> network
-statistics
423 echo "#" >> network
-statistics
424 /usr
/sbin
/netstat
-Q -I ${if} >> network
-statistics 2>&1
430 if [ -x /usr
/sbin
/ndp
]; then
431 echo "#" >> network
-statistics
432 echo "# ndp -n -a" >> network
-statistics
433 echo "#" >> network
-statistics
434 /usr
/sbin
/ndp
-n -a >> network
-statistics 2>&1
436 echo "#" >> network
-statistics
437 echo "# ndp -n -p" >> network
-statistics
438 echo "#" >> network
-statistics
439 /usr
/sbin
/ndp
-n -p >> network
-statistics 2>&1
441 echo "#" >> network
-statistics
442 echo "# ndp -n -r" >> network
-statistics
443 echo "#" >> network
-statistics
444 /usr
/sbin
/ndp
-n -r >> network
-statistics 2>&1
446 if [ -x /sbin
/ifconfig
]; then
447 for if in `/sbin/ifconfig -l`
449 echo "#" >> network
-statistics
450 echo "# ndp -i ${if}" >> network
-statistics
451 echo "#" >> network
-statistics
452 /usr
/sbin
/ndp
-i ${if} >> network
-statistics 2>&1
457 if [ -x /sbin
/pfctl
]; then
459 echo "# pfctl -s all" >> pf
461 ${PRIV} /sbin
/pfctl
-s all
>> pf
2>&1
462 echo "==============================" >> pf
464 echo "# pfctl -s References" >> pf
466 ${PRIV} /sbin
/pfctl
-s References
>> pf
2>&1
467 for ANCHOR
in `${PRIV} pfctl -s Anchors -v 2>/dev/null`
469 echo "==============================" >> pf
471 echo "# pfctl -a ${ANCHOR} -s all" >> pf
473 ${PRIV} /sbin
/pfctl
-a ${ANCHOR} -s all
>> pf
2>&1
480 if [ -x /usr
/local
/bin
/lsmp
]; then
481 ${PRIV} /usr
/local
/bin
/lsmp
-a -v > lsmp
2>&1
487 if [ -x /usr
/sbin
/lsof
]; then
488 ${PRIV} /usr
/sbin
/lsof
-n -P -T q
> lsof
2>&1
494 if [ -x /usr
/local
/bin
/ddt
]; then
495 /bin
/echo -n "" > dispatch
-info
501 echo "#" >> dispatch
-info
502 echo "# ddt -vkp ${BIN}" >> dispatch
-info
503 echo "#" >> dispatch
-info
504 ${PRIV} /usr
/local
/bin
/ddt
-vkp ${BIN} >> dispatch
-info 2>&1
511 if [ -x /usr
/bin
/odutil
]; then
513 echo "# odutil show all" >> od-info
515 ${PRIV} /usr
/bin
/odutil show all
>> od-info 2>&1
519 # IPsec configuration
521 if [ -x /usr
/sbin
/setkey
-a -x /usr
/bin
/perl
]; then
523 echo "# setkey -D" >> ipsec
525 ${PRIV} /usr
/sbin
/setkey
-D \
526 | /usr
/bin
/perl
-M'Digest::MD5 qw(md5_hex)' -l -n -e '
527 if (/^(\s+[AE]:\s+\S+\s+)"?(.*)"?\s*$/) {
528 printf "%s[MD5:%s]%s\n", $1, md5_hex($2 . "\n"), $3;
536 echo "# setkey -Pp -D" >> ipsec
538 ${PRIV} /usr
/sbin
/setkey
-Pp -D >> ipsec
540 for CF
in /var
/run
/racoon
/*.conf
542 if [ ! -r "${CF}" ]; then
548 echo "# ${CF}" >> ipsec
551 | /usr
/bin
/perl
-M'Digest::MD5 qw(md5_hex)' -l -n -e '
552 if (/^(\s+shared_secret\s+use\s+)"?([^\s;"]+)"?(.*)/) {
553 printf "%s[MD5:%s]%s\n", $1, md5_hex($2 . "\n"), $3;
562 # Kerberos configuration
564 if [ -x /usr
/bin
/klist
]; then
566 echo "# klist --verbose --all-content" >> kerberos
568 klist
--verbose --all-content >> kerberos
2>&1
571 echo "# ktutil list" >> kerberos
573 ${PRIV} /usr
/sbin
/ktutil
--verbose list
>> kerberos
2>&1
576 echo "# gsstool list --verbose" >> kerberos
578 /System
/Library
/PrivateFrameworks
/Heimdal.framework
/Helpers
/gsstool list
--verbose >> kerberos
2>&1
584 if [ -x /usr
/sbin
/system_profiler
]; then
585 system_profiler
-xml SPEthernetDataType \
586 SPFibreChannelDataType \
591 SPThunderboltDataType \
593 SPAirPortDataType
> system_profiler.spx
2>/dev
/null
597 # system usage statistics
599 /bin
/echo -n "" > system
-statistics
601 if [ -x /usr
/bin
/uptime
]; then
602 echo "#" >> system
-statistics
603 echo "# uptime" >> system
-statistics
604 echo "#" >> system
-statistics
605 /usr
/bin
/uptime
>> system
-statistics 2>&1
608 if [ -x /usr
/sbin
/sysctl
]; then
609 echo "#" >> system
-statistics
610 echo "# sysctl kern hw net debug" >> system
-statistics
611 echo "#" >> system
-statistics
612 /usr
/sbin
/sysctl kern hw net debug
>> system
-statistics 2>&1
615 if [ -x /usr
/bin
/zprint
]; then
616 echo "#" >> system
-statistics
617 echo "# zprint" >> system
-statistics
618 echo "#" >> system
-statistics
619 ${PRIV} /usr
/bin
/zprint
>> system
-statistics 2>&1
622 if [ -x /usr
/sbin
/lsof
-a -x /bin
/ls ]; then
624 /bin
/ls -1 /Library
/Preferences
/SystemConfiguration
/*-lock \
628 if [ ${N} -eq 0 ]; then
629 echo "#" >> system
-statistics
630 echo "# lsof [SCPreferences lock files]" >> system
-statistics
634 echo "#" >> system
-statistics
635 ${PRIV} /usr
/sbin
/lsof
-- ${lock} >> system
-statistics 2>&1
640 # collect executable and plugin info
644 if [ ! -f "${1}" ]; then
648 VERSION
=`what "${1}"`
649 echo "${VERSION}" >> versions
2>&1
652 echo "\tsum: ${SUM}" >> versions
2>&1
654 LSINFO
=`ls -lu "${1}"`
655 echo "\tadditional info: ${LSINFO}" >> versions
2>&1
657 echo "" >> versions
2>&1
663 /usr
/libexec
/InternetSharing \
664 /usr
/libexec
/bootpd \
665 /usr
/libexec
/configd \
668 /usr
/sbin
/mDNSResponder \
671 /System
/Library
/Frameworks
/SystemConfiguration.framework
/SystemConfiguration \
674 report_binary_info
"${BIN}"
677 if [ -x /usr
/bin
/xcode
-select -a -x /usr
/bin
/xcodebuild
-a -x /usr
/bin
/xcrun
]; then
678 SDKPATH
="`xcode-select --print-path 2>/dev/null`"
679 if [ $?
-eq 0 -a -n "${SDKPATH}" ]; then
680 /usr
/bin
/xcodebuild
-showsdks 2>/dev
/null \
682 | awk '{ print $NF }' \
685 SDKPATH
="`xcrun --sdk $SDK --show-sdk-path`"
687 /usr
/libexec
/configd_sim \
688 /System
/Library
/Frameworks
/SystemConfiguration.framework
/SystemConfiguration \
691 report_binary_info
"${SDKPATH}${BIN}"
695 echo "*** NO SDKs ***" >> versions
704 cd /System
/Library
/SystemConfiguration
705 for PLUGIN
in *.bundle
707 plugins
[$num]="${PLUGIN}"
713 for PLUGIN
in "${plugins[@]}"
715 PLUGIN_DIR
="/System/Library/SystemConfiguration/${PLUGIN}"
716 PLUGIN_INF
="${PLUGIN_DIR}/Contents/Info.plist"
717 if [ ! -f "${PLUGIN_INF}" ]; then
718 PLUGIN_INF
="${PLUGIN_DIR}/Info.plist"
719 if [ ! -f "${PLUGIN_INF}" ]; then
720 echo "${PLUGIN_INF}: No Info.plist" >> versions
2>&1
724 echo "${PLUGIN}" >> versions
2>&1
727 BOOL
=`scutil --get "${PLUGIN_INF}" / Enabled 2>/dev/null`
728 if [ $?
-eq 0 ]; then
729 if [ ${BOOL} = "TRUE" ]; then
735 echo "\t${ENABLED}" >> versions
2>&1
738 BOOL
=`scutil --get "${PLUGIN_INF}" / Verbose 2>/dev/null`
739 if [ $?
-eq 0 ]; then
740 if [ ${BOOL} = "TRUE" ]; then
744 if [ -n "${VERBOSE}" ]; then
745 echo "\t${VERBOSE}" >> versions
2>&1
748 VERSION
=`scutil --get "${PLUGIN_INF}" / CFBundleVersion 2>/dev/null`
749 if [ $?
-eq 1 ]; then
750 VERSION
=`scutil --get "${PLUGIN_INF}" / CFBundleShortVersionString 2>/dev/null`
752 echo "\tVersion: ${VERSION}" >> versions
2>&1
754 if [ -f "${PLUGIN_DIR}/Contents/MacOS/${PLUGIN%.*}" ]; then
755 SUM
=`sum "${PLUGIN_DIR}/Contents/MacOS/${PLUGIN%.*}"`
756 echo "\tsum: ${SUM}" >> versions
2>&1
758 LSINFO
=`ls -lu "${PLUGIN_DIR}/Contents/MacOS/${PLUGIN%.*}"`
759 echo "\tadditional info: ${LSINFO}" >> versions
2>&1
760 elif [ -f "${PLUGIN_DIR}/${PLUGIN%.*}" ]; then
761 SUM
=`sum "${PLUGIN_DIR}/${PLUGIN%.*}"`
762 echo "\tsum: ${SUM}" >> versions
2>&1
764 LSINFO
=`ls -lu "${PLUGIN_DIR}/${PLUGIN%.*}"`
765 echo "\tadditional info: ${LSINFO}" >> versions
2>&1
768 echo "" >> versions
2>&1
772 if [ -x /usr
/bin
/what
-a -x /usr
/bin
/sum -a -x /bin
/ls ]; then
778 # to give a chance for "networkd" and "mDNSResponder" to finish dumping their
779 # state, the last thing we do is collect the logs
783 # system log, kernel.log, early boot log messages
785 if [ -x /usr
/bin
/syslog
]; then
787 # save the recent activity
789 ${PRIV} /usr
/bin
/syslog
-T local.3 \
790 | ${TAIL_25000} > syslog
793 # save just the "kernel" activity (in case some of the
794 # interesting/relevant message are before the messages
797 ${PRIV} /usr
/bin
/syslog
-T local.3 -k Facility kern \
798 | ${TAIL_25000} > kernel
800 if [ -d /var
/log
/DiagnosticMessages
]; then
801 # save any MessageTracer activity
802 ${PRIV} /usr
/bin
/syslog
-d /var
/log
/DiagnosticMessages \
805 | ${TAIL_25000} > DiagnosticMessages
808 if [ -f /var
/log
/system.log
]; then
809 ${PRIV} ${TAIL_25000} /var
/log
/system.log
> system.log
811 if [ -f /var
/log
/kernel.log
]; then
812 ${PRIV} ${TAIL_25000} /var
/log
/kernel.log
> kernel.log
815 if [ -x /sbin
/dmesg
]; then
816 ${PRIV} /sbin
/dmesg
> dmesg
820 # IPConfiguration log
822 if [ -f /var
/log
/com.apple.IPConfiguration.bootp
]; then
823 ${PRIV} ${TAIL_2000} /var
/log
/com.apple.IPConfiguration.bootp \
824 > com.apple.IPConfiguration.bootp
830 scutil
<<_END_OF_INPUT \
834 if (index($2, "/") == 1) { print $2 } \
835 else { print "/var/log/ppp/" $2 } \
838 print "/tmp/pppotcp.log" \
844 show Setup:/Network/Service/[^/]+/PPP pattern
848 if [ -f "${logFile}" ]; then
849 b
="`basename ${logFile}`"
850 cat "${logFile}" > "${b}" 2>&1
855 # application firewall log
857 if [ -f /var
/log
/appfirewall.log
]; then
858 ${PRIV} ${TAIL_2000} /var
/log
/appfirewall.log
> appfirewall.log
861 if [ -x /bin
/ls ]; then
863 # collect crash reports
874 mDNSResponderHelper \
880 /bin
/ls -1 /Library
/Logs
/DiagnosticReports
/${daemon}_
*.crash \
881 /Library
/Logs
/DiagnosticReports
/${daemon}_
*.ips \
882 /Library
/Logs
/CrashReporter
/${daemon}_
*.crash \
883 /Library
/Logs
/CrashReporter
/${daemon}_
*.ips \
884 /Library
/Logs
/CrashReporter
/${daemon}_
*.plist \
888 if [ -f "${log}" ]; then
889 b
="`basename ${log}`"
890 ${PRIV} cat "${log}" > "${b}" 2>&1
896 # collect any verbose logging output
898 /bin
/ls -1 /Library
/Logs
/CrashReporter
/com.apple.networking.
*.log
* \
902 if [ -f "${log}" ]; then
903 b
="`basename ${log}`"
904 ${PRIV} cat "${log}" > "${b}" 2>&1
912 if [ -x /usr
/local
/bin
/crstackshot
]; then
913 /usr
/local
/bin
/crstackshot
2>/dev
/null
917 # collect everything into a single archive
920 tar -c ${GZ_OPT} -f "${ARCHIVE}" "${OUT}"
923 if [ ${UID} -eq 0 ]; then
924 if [ -n "${SUDO_UID}" -a -n "${SUDO_GID}" ]; then
925 if [ ${UID} -ne ${SUDO_UID} ]; then
926 chown
${SUDO_UID}:${SUDO_GID} "${ARCHIVE}"
931 echo "Network data collected to \"${ARCHIVE}\""