Created
September 2, 2019 20:50
-
-
Save mrloop/06e45e8e92378304d3d9d864a7a9c5c6 to your computer and use it in GitHub Desktop.
FreeBSD AdGuardHome process management /etc/rc.d/adguardhome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# PROVIDE: AdGuardHome | |
# REQUIRE: networking | |
# KEYWORK: | |
# | |
# see https://redbyte.eu/en/blog/supervised-freebsd-init-script-for-go-deamon/ | |
# remember to add `adguardhome_enable='YES` to `/etc/rc.conf` | |
. /etc/rc.subr | |
name=AdGuardHome | |
rcvar="adguardhome_enable" | |
adguardhome_command="/AdGuardHome/AdGuardHome" | |
pidfile="/var/run/${name}.pid" | |
command="/usr/sbin/daemon" | |
command_args="-P ${pidfile} -r -f ${adguardhome_command}" | |
load_rc_config $name | |
: ${adguard_enable:=no} | |
run_rc_command $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment