blob: 2a81b5f3638ca88c23e19d3d377fab8f59b9c1cc (
plain) (
blame)
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
|
#! /bin/bash
#
# Copyright (c) 2018 Apple Inc. All rights reserved.
#
# This script is currently for Apple Internal use only.
#
version=1.0
script=${BASH_SOURCE[0]}
#============================================================================================================================
# PrintUsage
#============================================================================================================================
PrintUsage()
{
echo ""
echo "Usage: $( basename "${script}" ) [options]"
echo ""
echo "Options:"
echo " -V Display version of this script and exit."
echo ""
}
#============================================================================================================================
# main
#============================================================================================================================
main()
{
while getopts ":hV" option; do
case "${option}" in
h)
PrintUsage
exit 0
;;
V)
echo "$( basename "${script}" ) version ${version}"
exit 0
;;
:)
ErrQuit "option '${OPTARG}' requires an argument."
;;
*)
ErrQuit "unknown option '${OPTARG}'."
;;
esac
done
[ "${OPTIND}" -gt "$#" ] || ErrQuit "unexpected argument \""${!OPTIND}"\"."
launchctl load /Library/LaunchDaemons/com.apple.mDNSResponder.mdns-tcpdump.plist
launchctl start com.apple.mDNSResponder.mdns-tcpdump
}
main "$@"
|