Skip to content

Instantly share code, notes, and snippets.

@mrloop
Created September 2, 2019 20:50
Show Gist options
  • Save mrloop/06e45e8e92378304d3d9d864a7a9c5c6 to your computer and use it in GitHub Desktop.
Save mrloop/06e45e8e92378304d3d9d864a7a9c5c6 to your computer and use it in GitHub Desktop.
FreeBSD AdGuardHome process management /etc/rc.d/adguardhome
#!/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