aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/svc.bash12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/util/svc.bash b/lib/util/svc.bash
index 403615f..3a5f7b2 100644
--- a/lib/util/svc.bash
+++ b/lib/util/svc.bash
@@ -47,8 +47,20 @@ svc_enable() {
local system="bashtard/svc/enable"
local service=$1
+ local rc
case "${BASHTARD_PLATFORM[key]}" in
+ freebsd)
+ rc="$(printf '%s_enable="YES"' "$service")"
+
+ if ! grep -Fqx "$rc" "/etc/rc.conf.d/$service"
+ then
+ printf "%s\n" "$rc" >> "/etc/rc.conf.d/$service"
+ fi
+
+ return 0
+
+ ;;
linux-gentoo) set -- /sbin/rc-update add "$service" ;;
linux-*) set -- systemctl enable "$service" ;;
*)