%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/pm-utils/sleep.d/
Upload File :
Create Path :
Current File : //lib64/pm-utils/sleep.d/49bluetooth

#!/bin/sh
# IBM specific hack to disable/enable bluetooth.
# TODO: Doesn't the working USB suspend/resume functionality
#       make this code more or less obsolete?

. "${PM_FUNCTIONS}"

[ -f /proc/acpi/ibm/bluetooth ] || exit $NA

suspend_bluetooth()
{
	if grep -q enabled /proc/acpi/ibm/bluetooth; then
		savestate ibm_bluetooth enable
		echo disable > /proc/acpi/ibm/bluetooth
	else
		savestate ibm_bluetooth disable
	fi
}

resume_bluetooth()
{
	state_exists ibm_bluetooth || return
	restorestate ibm_bluetooth > /proc/acpi/ibm/bluetooth
}

case "$1" in
	hibernate|suspend)
		suspend_bluetooth
		;;
	thaw|resume)
		resume_bluetooth
		;;
	*) exit $NA
		;;
esac

Zerion Mini Shell 1.0