obsdfreqd: add rc file and install instructions

This commit is contained in:
Solene Rapenne 2022-03-16 22:45:45 +01:00
parent 4e5fd1f43b
commit 706e252ea0
3 changed files with 29 additions and 1 deletions

View File

@ -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

View File

@ -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.

11
obsdfreqd.rc Normal file
View File

@ -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