1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-30 05:40:06 +00:00
freebsd-ports/sysutils/asusoled/files/asusoled.sh.in
Jung-uk Kim 53a60a3918 This port provides a utility for controlling USB OLED display found
on some ASUS laptops such as G-series models.

Originally it was written by Christian Lamparter <chunkeey@web.de>
for Linux and the early version is still available from here:

	https://launchpad.net/asusoled

Now it is almost rewrite of the code with a lot of new features and
improvements by Jung-uk Kim <jkim@FreeBSD.org>.
2008-09-23 21:19:03 +00:00

55 lines
1.0 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: asusoled
# REQUIRE: DAEMON
# KEYWORD: nojail shutdown
#
# Add the following lines to /etc/rc.conf to enable the ASUS OLED display:
#
# asusoled_enable="YES"
#
asusoled_enable=${asusoled_enable-"NO"}
asusoled_flags=${asusoled_flags-"-f %%PREFIX%%/share/asusoled/asus.png"}
asusoled_command=${asusoled_command-""}
. /etc/rc.subr
name=asusoled
rcvar=`set_rcvar`
start_cmd=asusoled_start
stop_cmd=asusoled_stop
asusoled_bin="%%PREFIX%%/sbin/asusoled"
asusoled_pidfile="/var/run/${name}.pid"
asusoled_start() {
if checkyesno asusoled_enable
then
echo "Starting asusoled."
${asusoled_bin} -e || exit 1
if test ! -z "${asusoled_command}"
then
${asusoled_bin} ${asusoled_flags} -c "${asusoled_command}"
else
${asusoled_bin} ${asusoled_flags}
fi
fi
}
asusoled_stop() {
if checkyesno asusoled_enable
then
echo "Stopping asusoled."
test -f ${asusoled_pidfile} &&
${asusoled_bin} -k -p ${asusoled_pidfile}
${asusoled_bin} -d
fi
}
load_rc_config ${name}
run_rc_command "$1"