Custom Init Runlevels script

This is the file in ~/bin/init to replace the standard init script. It will only work if your home/bin directory is before /sbin in the path.

  #!/bin/bash
  if [ "$1" -eq 7 ] ; then
         sudo acpitool -s;
  else
         if [ "$1" -eq 8 ] ; then
                 sudo acpitool -S;
         else
                 sudo /sbin/init "$1";
         fi
  fi

It is setup such that the standard runlevels (0-6) are passed straight back to the /sbin/init script while level 7 is suspend-to-ram and runs

acpitool -s

And runlevel 8 runs suspend-to-hdd

acpitool -S
desktop/custom_runlevels_script.txt · Last modified: 2017/02/05 17:43 (external edit)
Back to top
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0