gensokyo_kappa-overlay/sys-apps/usbguard/files/openRC/usbguard
Kimitsune ff9ef16c55 Fixed usbguard ebuild. openRC support should be working.
-Added files needed for openRC support. (init scripts and configuration
files)
-Updated ebuild to install them.

TODO: do not install openRC support files if systemD USE flag is set.
This will probably never be done because if you are crasy enough to use
systemD, you should use other ebuilds you can find on internet. (And i
don't care about systemD)
2018-10-28 14:07:03 +01:00

30 lines
766 B
Plaintext

#!/sbin/openrc-run
depend() {
need localmount
after consolekit
after bootmisc
use logger
provide usb-access-control
provide usbguard
}
start_pre() {
ebegin "Pre-start security checks for usbguard"
checkpath --directory --owner root:root /etc/usbguard/
checkpath --file --owner root:root --mode 0600 /etc/usbguard/usbguard-daemon.conf /etc/usbguard/rules.conf
eend $?
}
start() {
ebegin "Starting usbguard daemon"
start-stop-daemon --start --pidfile /var/run/usbguard.pid --exec /usr/sbin/usbguard-daemon -- -f -s -K $APPEND
eend $?
}
stop() {
ebegin "Stopping usbguard daemon"
start-stop-daemon --stop --pidfile /var/run/usbguard.pid --exec /usr/sbin/usbguard-daemon -- -f -s -K $APPEND
eend $?
}