Skip to content

Instantly share code, notes, and snippets.

@jackpooley
Last active December 10, 2015 21:18
Show Gist options
  • Select an option

  • Save jackpooley/4493864 to your computer and use it in GitHub Desktop.

Select an option

Save jackpooley/4493864 to your computer and use it in GitHub Desktop.
After Firmware update MBP hibernate mode is automatically set to 3 on shutdown (ignores 'sudo pmset -a hibernatemode 0' command).
#!/usr/bin/env bash
#
# force_disable_hibernate_mode.sh
#
# More Info: https://discussions.apple.com/thread/4492672?start=0&tstart=0
#
# First, disable hibernation mode:
sudo pmset -a hibernatemode 0
# Delete /private/var/vm/sleepimage:
sudo rm /private/var/vm/sleepimage
# Option 1: Lock hibernatefile
function lock_hibernatefile ()
{
# create an empty file and name it 'sleepimage':
sudo touch /private/var/vm/sleepimage
# change its flag to immutable:
sudo chflags uchg /private/var/vm/sleepimage
}
# Option 2: Set hibernatefile to /dev/null
function set_hibernatefile_to_dev_null ()
{
sudo pmset -a hibernatefile /dev/null
}
lock_hibernatefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment