LetUserSetUpDVDROMRegionCode: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
== The script == | == The script == | ||
* tested on 10.4.8 | * tested on 10.4.8-10.6.8, probably working on 10.7 as well! | ||
* must be run as root, might be delivered with FileWave or launched when admin is setting up the computer. | * must be run as root, might be delivered with [[FileWave]] or launched when admin is setting up the computer. | ||
---- | ---- | ||
Line 29: | Line 29: | ||
# -Taking over the world, Pinky! | # -Taking over the world, Pinky! | ||
# | # | ||
# Globals | # Globals | ||
# | # | ||
Line 39: | Line 39: | ||
GAPPMV="/bin/mv" | GAPPMV="/bin/mv" | ||
GAPPWHOAMI="/usr/bin/whoami" | GAPPWHOAMI="/usr/bin/whoami" | ||
# Unmain | # Unmain | ||
# | # | ||
if [ "`${GAPPWHOAMI}`" = "root" ]; then | if [ "`${GAPPWHOAMI}`" = "root" ]; then | ||
${GAPPCP} -pr ${GFILEPLIST} ${GFILETEMPPLIST} | ${GAPPCP} -pr ${GFILEPLIST} ${GFILETEMPPLIST} | ||
${GAPPDEFAULTS} write ${GFILETEMP} rights -dict-add system.device.dvd.setregion.initial "<dict><key>class</key><string>allow</string><key>shared</key><true/><key>comment</key><string>This dictionary has changed, so that unprivileged users can setup inital dvd region code.</string><key>group></key><string>admin</string></dict>" | ${GAPPDEFAULTS} write ${GFILETEMP} rights -dict-add system.device.dvd.setregion.initial "<dict><key>class</key><string>allow</string><key>shared</key><true/><key>comment</key><string>This dictionary has changed, so that unprivileged users can setup inital dvd region code.</string><key>group></key><string>admin</string></dict>" | ||
${GAPPMV} ${GFILETEMPPLIST} ${GFILEPLIST} | ${GAPPMV} ${GFILETEMPPLIST} ${GFILEPLIST} | ||
else | else | ||
echo "This script can only be run as root. No changes made." | echo "This script can only be run as root. No changes made." | ||
fi | fi | ||
[[Category:Development]] | |||
[[Category:Shell]] |
Latest revision as of 22:18, 30 November 2011
This is just a little script I wrote because many users are not allowed to administrate their computers, but should be able to set up the DVD-ROM-drive for the first time a video-DVD is played:
Attention
You use this script at your own risk! Everything can happen, when messing around with system configuration, even data loss.
The script
- tested on 10.4.8-10.6.8, probably working on 10.7 as well!
- must be run as root, might be delivered with FileWave or launched when admin is setting up the computer.
#!/bin/sh # # Script : regionCodeSetupAllow.sh # Author : Heiko Kretschmer # Purpose: Setting /etc/authorization up, so that unprivileged users can set the dvd region code (initial) # # # History: # 2006-12-12, 15:20: Inital creation of this script. # # # ToDo: # # -Taking over the world, Pinky! # # Globals # GFILETEMP="/tmp/authorization" GFILETEMPPLIST="${GFILETEMP}.plist" GFILEPLIST="/etc/authorization" GAPPCP="/bin/cp" GAPPDEFAULTS="/usr/bin/defaults" GAPPMV="/bin/mv" GAPPWHOAMI="/usr/bin/whoami" # Unmain # if [ "`${GAPPWHOAMI}`" = "root" ]; then ${GAPPCP} -pr ${GFILEPLIST} ${GFILETEMPPLIST} ${GAPPDEFAULTS} write ${GFILETEMP} rights -dict-add system.device.dvd.setregion.initial "<dict><key>class</key><string>allow</string><key>shared</key><true/><key>comment</key><string>This dictionary has changed, so that unprivileged users can setup inital dvd region code.</string><key>group></key><string>admin</string></dict>" ${GAPPMV} ${GFILETEMPPLIST} ${GFILEPLIST} else echo "This script can only be run as root. No changes made." fi