summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service/freebsd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/provider/service/freebsd.rb')
-rw-r--r--lib/chef/provider/service/freebsd.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/service/freebsd.rb b/lib/chef/provider/service/freebsd.rb
index 49ba0d7d16..9204e3ef92 100644
--- a/lib/chef/provider/service/freebsd.rb
+++ b/lib/chef/provider/service/freebsd.rb
@@ -180,7 +180,7 @@ class Chef
def set_service_enable(value)
lines = read_rc_conf
# Remove line that set the old value
- lines.delete_if { |line| line =~ /^#{Regexp.escape(service_enable_variable_name)}=/ }
+ lines.delete_if { |line| line =~ /^\#?\s*#{Regexp.escape(service_enable_variable_name)}=/ }
# And append the line that sets the new value at the end
lines << "#{service_enable_variable_name}=\"#{value}\""
write_rc_conf(lines)