#!/bin/sh ## # Disable IR ## . /etc/rc.common StartService () { if [ ! -d /System/Library/Extensions/AppleIRController.kext ]; then echo "ERROR: wanted to disable AppleIRController but couldn't find kext file." exit fi if [ "${DISABLEIR:=-NO-}" = "-YES-" ]; then echo "Disabling AppleIRController" kextunload /System/Library/Extensions/AppleIRController.kext else echo "Enabling AppleIRController" kextload /System/Library/Extensions/AppleIRController.kext fi } StopService () { if [ ! -d /System/Library/Extensions/AppleIRController.kext ]; then echo "ERROR: wanted to disable AppleIRController but couldn't find kext file." exit fi if [ "${DISABLEIR:=-NO-}" = "-YES-" ]; then echo "Enabling AppleIRController" kextload /System/Library/Extensions/AppleIRController.kext else echo "Disabling AppleIRController" kextunload /System/Library/Extensions/AppleIRController.kext fi } RestartService () { StopService; StartService; } RunService "$1"