obsdfreqd: add rc file and install instructions
This commit is contained in:
parent
4e5fd1f43b
commit
706e252ea0
11
Makefile
11
Makefile
|
@ -1,5 +1,14 @@
|
|||
all:
|
||||
PREFIX=/usr/local
|
||||
|
||||
obsdfreqd:
|
||||
clang main.c -o obsdfreqd -lm
|
||||
|
||||
all: obsdfreqd
|
||||
|
||||
clean:
|
||||
rm obsdfreqd
|
||||
|
||||
install: obsdfreqd
|
||||
install -o root -g wheel -m 555 obsdfreqd ${PREFIX}/sbin/obsdfreqd
|
||||
install -o root -g wheel -m 555 obsdfreqd.rc /etc/rc.d/obsdfreqd
|
||||
install -o root -g wheel -m 444 obsdfreqd.1 ${PREFIX}/man/man1/obsdfreqd.1
|
||||
|
|
|
@ -10,6 +10,14 @@ As easy as `make`
|
|||
|
||||
Run `obsdfreqd` as root, quit with `Ctrl+C`.
|
||||
|
||||
# Installation
|
||||
|
||||
`make install` as root, enable the service using `rcctl enable
|
||||
obsdfreqd` and set flags as you want using `rcctl set obsdfreqd
|
||||
flags -q` for example.
|
||||
|
||||
Start the service with `rcctl start obsdfreqd`.
|
||||
|
||||
# Usage
|
||||
|
||||
Parameters are applied when both plugged on the wall or on battery, parameters can have two values comma separated to give different values when plugged on wall and for when on battery.
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/ksh
|
||||
|
||||
daemon="/usr/local/sbin/obsdfreqd"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
pexp="${daemon}.*"
|
||||
rc_reload=NO
|
||||
rc_bg=YES
|
||||
|
||||
rc_cmd $1
|
Reference in New Issue