# disable_airdrop.sh
#!/bin/bash
# disable_airdrop.sh
# OS X 10.9.2
#
home=$HOME
#---------------------------------------------------------------------
# defaults write com.apple.NetworkBrowser
#---------------------------------------------------------------------
# osx - how to disable Airdrop on Mac Book Pro (Retina)? - Super User
# http://superuser.com/questions/568676/how-to-disable-airdrop-on-mac-book-pro-retina
#
sudo defaults write /Library/Preferences/com.apple.NetworkBrowser DisableAirDrop -bool Yes
sudo defaults write /Library/Preferences/com.apple.NetworkBrowser BrowseAllInterfaces -bool No
defaults write com.apple.NetworkBrowser DisableAirDrop -bool Yes
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool No
#---------------------------------------------------------------------
# unload agents
#---------------------------------------------------------------------
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.sharingd.plist
sudo chmod 0 /System/Library/LaunchAgents/com.apple.sharingd.plist
# 2014-03-03
# man sharingd に書かれいる /usr/libexec/sharingd は存在していなかった。
#
# "shringd" の "d" がない方のマニュアルを読んでみたところ
# sharing は様々なサービス(smb とか)の share point を提供するものだとわかった。
# パスもわかった。
#
# $ man sharing
# =>
# sharing -- create share points for afp, ftp and smb services.
# ...
#
sudo chmod 0 /usr/sbin/sharing
#---------------------------------------------------------------------
# remove Plugins
#---------------------------------------------------------------------
hal=$home/backup-lib-audio-plugin-hal
mkdir $hal
sudo mv /Library/Audio/Plug-Ins/HAL/ $hal
#---------------------------------------------------------------------
# remove System/Library/PrivateFrameworks/ShareKit
#---------------------------------------------------------------------
sk=$home/backup-lib-private-framework-sharekit-plugins
mkdir $sk
sudo mv /System/Library/PrivateFrameworks/ShareKit.framework/Versions/A/PlugIns $sk/
#---------------------------------------------------------------------
# reject udp 5353
#---------------------------------------------------------------------
sudo ipfw -q add reject udp from any to me dst-port 5353
# 2014-03-01
bloggger においてのTag 追記
# 2014-03-01
# 追記。
% whatis airdrop
airdrop: nothing appropriate
% whatis AirDrop
AirDrop: nothing appropriate
% whereis AirDrop
% whereis AirDropd
% whereis airdropd
%
% apropoe airdrop
airdrop: nothing appropriate
% apropos AirDrop
AirDrop: nothing appropriate
# HERE!
% man -K AirDrop
/usr/share/man/man8/sharingd.8? [ynq] y
% man sharingd
sharingd(8) BSD System Manager's Manual sharingd(8)
NAME
sharingd -- Sharing Daemon that enables AirDrop, Shared Computers, and Remote Disc in the Finder.
SYNOPSIS
sharingd
DESCRIPTION
sharingd is used by the Finder to enable AirDrop file sharing, connecting to shared computers, and accessing Remote Discs from other computers.
FILES
/usr/libexec/sharingd
HISTORY
sharingd first appeared in Mac OS X 10.9.
Darwin March 1, 2014 Darwin
(END)
# 2014-03-01
# 追記。
osx - how to disable Airdrop on Mac Book Pro (Retina)? - Super User
# 2014-03-02
複数の # を削除。
# 2014-03-04
# UPDATED: 2014-03-04T06:45:46.525+09:00
# $ man sharing 追記
# 2014-03-07
# 公開日時の訂正
http://midorex.blogspot.com/2014/03/published-date.html
# MEMO
# 2014-03-12
% cat /etc/pf.anchors/com.apple
#
# com.apple ruleset, referred to by the default /etc/pf.conf file.
# See notes in that file regarding the anchor point in the main ruleset.
#
# Copyright (c) 2011 Apple Inc. All rights reserved.
#
#
# AirDrop anchor point.
#
anchor "200.AirDrop/*"
#
# Application Firewall anchor point.
#
anchor "250.ApplicationFirewall/*"
%
% man pfctl
0 件のコメント:
コメントを投稿