HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //proc/self/root/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/openwrt.rb
Puppet::Type.type(:service).provide :openwrt, :parent => :init, :source => :init do
  desc <<-EOT
    Support for OpenWrt flavored init scripts.

    Uses /etc/init.d/service_name enable, disable, and enabled.

  EOT

  defaultfor :operatingsystem => :openwrt
  confine :operatingsystem => :openwrt

  has_feature :enableable

  def self.defpath
    ["/etc/init.d"]
  end

  def enable
    system(self.initscript, 'enable')
  end

  def disable
    system(self.initscript, 'disable')
  end

  def enabled?
    # We can't define the "command" for the init script, so we call system?
    if system(self.initscript, 'enabled') then return :true else return :false end
  end

  # Purposely leave blank so we fail back to ps based status detection
  # As OpenWrt init script do not have status commands
  def statuscmd
  end

end