SHARE
TWEET

Untitled

a guest May 23rd, 2016 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- /usr/sbin/pm-suspend 2016-05-16 18:59:01.623376619 +0200
  2. +++ /usr/sbin/pm-suspend 2016-05-16 19:03:43.420630720 +0200
  3. @@ -68,6 +68,10 @@
  4.  while [ $# -gt 0 ]
  5.  do
  6.   [ "$1" = "--help" ] && help
  7. +  [ "$1" = "--direct" ] && {
  8. +    shift
  9. +    DO_DIRECT="$1"
  10. +  }
  11.   shift
  12.  done
  13.  
  14. @@ -95,16 +99,19 @@
  15.  load_hook_parameters
  16.  
  17.  # run the sleep hooks
  18. +[ "${DO_DIRECT}" != "false" ] && {
  19.  log "$(date): Running hooks for $ACTION."
  20.  if run_hooks sleep "$ACTION $METHOD"; then
  21.          # Sleep only if we know how and if a hook did not inhibit us.
  22.   log "$(date): performing $METHOD"
  23.   sync
  24. - "do_$METHOD" || r=128
  25. +  [ -z "${DO_DIRECT}" ] && "do_$METHOD" || r=128
  26.   log "$(date): Awake."
  27.  else
  28.   log "$(date): Inhibit found, will not perform $METHOD"
  29.  fi
  30. +}
  31. +[ "${DO_DIRECT}" = "true" ] && exit $r
  32.  log "$(date): Running hooks for $REVERSE"
  33.  # run the sleep hooks in reverse with the wakeup action
  34.  if run_hooks sleep "$REVERSE $METHOD" reverse; then
RAW Paste Data
Top