#!/bin/sh

# tlp - system startup/shutdown
#
# Copyright (c) 2015 Thomas Koch <linrunner at gmx.net>
# This software is licensed under the GPL v2 or later.

### BEGIN INIT INFO
# Provides:          tlp
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: tlp start/stop script
# Description:       Initialize tlp
### END INIT INFO

. /lib/lsb/init-functions

TLP=/usr/sbin/tlp
[ -x $TLP ] || exit 0

case "$1" in
    status)
        tlp-stat -s
        ;;

    start|\
    stop|\
    restart|\
    force-reload)
        $TLP init $1
        ;;

     *)
        echo "Usage: $0 start|stop|restart|force-reload|status" 1>&2
        exit 3
        ;;
esac

exit 0
