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

本文提供了一种方法,允许非管理员用户在Mac系统上更改DVD的区域设置。通过使用特定的脚本和PlistBuddy工具,可以为普通用户提供修改DVD区域代码的权限。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值