app/config/build/mac/pkg/scripts/postinstall

28 lines
861 B
Plaintext
Raw Permalink Normal View History

2018-10-04 03:24:57 +00:00
#!/bin/sh
2018-10-04 05:59:36 +00:00
PRODUCT_NAME="overFlow-NetworkScanner"
2018-10-04 07:10:25 +00:00
mkdir "/Library/Application Support/$PRODUCT_NAME"
cp -r "$2/$PRODUCT_NAME.app/Contents/Resources/ChmodBPF" "/Library/Application Support/overFlow-NetworkScanner/ChmodBPF"
chmod 775 "/Library/Application Support/overFlow-NetworkScanner/ChmodBPF/ChmodBPF"
2018-10-04 05:49:34 +00:00
CHMOD_BPF="/Library/LaunchDaemons/com.loafle.overflow.scanner.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/overFlow-NetworkScanner/ChmodBPF/com.loafle.overflow.scanner.ChmodBPF.plist" \
"$CHMOD_BPF"
chmod 755 "$CHMOD_BPF"
chown root:wheel "$CHMOD_BPF"
rm -rf /Library/StartupItems/ChmodBPF
launchctl load "$CHMOD_BPF"
exit 0