aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/macosx/Scripts/chmodbpf-postinstall.sh
blob: cbd2f08f128461fb0db67c5fd5f8c2a7c88cb89d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

CHMOD_BPF="/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
BPF_GROUP="access_bpf"
BPF_GROUP_NAME="BPF device access ACL"

dscl . -read /Groups/"$BPF_GROUP" > /dev/null 2>&1 || \
    dseditgroup -q -o create "$BPF_GROUP"
dseditgroup -q -o edit -a "$USER" -t user "$BPF_GROUP"

cp "/Library/Application Support/Wireshark/ChmodBPF/org.wireshark.ChmodBPF.plist" \
    "$CHMOD_BPF"
chmod 755 "$CHMOD_BPF"
chown root:wheel "$CHMOD_BPF"

launchctl load "$CHMOD_BPF"