`
xitong
  • 浏览: 6197979 次
文章分类
社区版块
存档分类
最新评论

Mac:让非admin用户改变DVD的区码

 
阅读更多

Mac系统,默认地禁止普通非管理员用户变更DVD的区码,所以下面的代码将准许这个行为。

#!/bin/sh
####################################################################################################
#
#	Allows non-admins to change region code & sets the region code to 1st entered DVD.
#
#
#	29/02/12 Ben Toms
#
#####################################################################################################OS=`/usr/bin/defaults read /System/Library/CoreServices/SystemVersion ProductVersion | awk '{print substr($1,1,4)}'`if [[ "$OS" < "10.5" ]]; then
echo "Unlocking region code setting using OS $OS..."
if [[ -f "/Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy" ]]; then
sudo /Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:class string allow" /etc/authorization
sudo /Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:comment string “Allows any user to change the DVD region code after it has been set the first time.”" /etc/authorization
sudo /Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:group string user" /etc/authorization
Asudo /Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:shared bool true" /etc/authorization
else
echo "PlistBuddy command not found. The DVD region code cannot be unlocked. Please ensure that PlistBuddy is installed at /Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy."
fi
else
echo "Unlocking region code setting using OS $OS..."
if [[ -f "/usr/libexec/PlistBuddy" ]]; then
sudo /usr/libexec/PlistBuddy -c "Set :rights:system.device.dvd.setregion.initial:class allow" /etc/authorization
sudo /usr/libexec/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:class string allow" /etc/authorization
sudo /usr/libexec/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:comment string “Allows any user to change the DVD region code after it has been set the first time.”" /etc/authorization
sudo /usr/libexec/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:group string user" /etc/authorization
sudo /usr/libexec/PlistBuddy -c "Add :rights:system.device.dvd.setregion.change:shared bool true" /etc/authorization
else
echo "PlistBuddy command not found. The DVD region code cannot be unlocked. Please ensure that PlistBuddy is installed at /usr/libexec/PlistBuddy."
fi
fi

参见:

http://macmule.com/2012/02/29/how-to-enable-non-admins-to-change-dvd-region-code/

http://themacadmin.com/?p=136

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics