#!/bin/sh

case "$1" in
  start)
    echo 'Maintenance mode -> no boot scripts will be run'
    
    #prevent spawning of gettys
    kill -TSTP 1
    
    #kill any gettys that were spawned
    kill -TERM 1

    #respawn sulogin in the background so that this script can terminate
    #and init will reap processes properly
    (while [ "$?" != 143 ]; do sulogin ; done ;)&
    ;;
  stop)
    killall sulogin
    ;;
  *)
    exit 1
    ;;
esac
    
exit 0
