forked from osmocom/wireshark
macOS: Switch ChmodBPF back from bash to sh.
The default shell in macOS 10.15 is zsh[1]. Bash appears to be included for now, but it might be a good idea to start migrating away from it just in case it's removed at some point in the future. [1]https://support.apple.com/en-ca/HT208050 Change-Id: Ibe4338105d8fa1a590f84543489255ade71920d6 Reviewed-on: https://code.wireshark.org/review/35216 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
parent
9a647c6ed5
commit
17bb0b7eb1
|
@ -1,4 +1,4 @@
|
|||
#! /bin/bash
|
||||
#! /bin/sh
|
||||
|
||||
#
|
||||
# Unfortunately, macOS's devfs is based on the old FreeBSD
|
||||
|
@ -26,15 +26,15 @@ SYSCTL_MAX=$( sysctl -n debug.bpf_maxdevices )
|
|||
if [ "$FORCE_CREATE_BPF_MAX" -gt "$SYSCTL_MAX" ] ; then
|
||||
FORCE_CREATE_BPF_MAX=$SYSCTL_MAX
|
||||
fi
|
||||
|
||||
|
||||
syslog -s -l notice "ChmodBPF: Forcing creation and setting permissions for /dev/bpf*"
|
||||
|
||||
CUR_DEV=0
|
||||
while [ "$CUR_DEV" -lt "$FORCE_CREATE_BPF_MAX" ] ; do
|
||||
# Try to do the minimum necessary to trigger the next device.
|
||||
read -n 0 < /dev/bpf$CUR_DEV > /dev/null 2>&1
|
||||
CUR_DEV=$(( $CUR_DEV + 1 ))
|
||||
: < /dev/bpf$CUR_DEV > /dev/null 2>&1
|
||||
CUR_DEV=$(( CUR_DEV + 1 ))
|
||||
done
|
||||
|
||||
|
||||
chgrp access_bpf /dev/bpf*
|
||||
chmod g+rw /dev/bpf*
|
||||
|
|
Loading…
Reference in New Issue