slackbuilds_ponce/misc/g15daemon/51g15hook.sh

39 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/sh
# g15daemon hook script for pm-utils.
# If you use g15daemon in conjunction with pm-utils, this hook script
# stops g15daemon when suspending/hinernating and restarts it when
# resuming/thawing.
# Copyright (c) 2011 Alan Alberghini <414N@slacky.it>
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
# any purpose with or without fee is hereby granted, provided that
# the above copyright notice and this permission notice appear in all
# copies.
#
# THIS SOFTWARE IS PROVIDED AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
if [ -x /etc/rc.d/rc.g15daemon ]
then
case $1 in
resume|thaw)
/etc/rc.d/rc.g15daemon restart
;;
hibernate)
/etc/rc.d/rc.g15daemon stop
;;
esac
fi