Skip to content

Instantly share code, notes, and snippets.

@massive
Created September 26, 2011 06:51
Show Gist options
  • Select an option

  • Save massive/1241738 to your computer and use it in GitHub Desktop.

Select an option

Save massive/1241738 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Aug 30, 2011.
    9 changes: 9 additions & 0 deletions hibernate.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/bin/bash
    if [ "$(whoami)" != 'root' ]; then
    echo "You have no permission to run $0 as non-root user."
    exit 1;
    fi
    pmset hibernatemode 25
    osascript -e 'tell application "System Events" to sleep'
    sleep 5m
    pmset hibernatemode 3