aboutsummaryrefslogblamecommitdiff
path: root/etc/rc.d/apmd
blob: beca9121172ae5bf6a5e3131b5572fd131cdc744 (plain) (tree)
1
2
3
4
5
6
7
8
9

         
           


               
                     
                
                          



              
                   
                           
                            


               
                                             
             
                                            



                                                                      
                                                                              
                  
                  


                        
            

 

                    
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: apmd
# REQUIRE: DAEMON apm
# BEFORE:  LOGIN
# KEYWORD: nojail shutdown

. /etc/rc.subr

name="apmd"
rcvar="apmd_enable"
command="/usr/sbin/${name}"
start_precmd="apmd_prestart"

apmd_prestart()
{
	case `${SYSCTL_N} hw.machine_arch` in
	i386)
		force_depend apm || return 1

		# Warn user about acpi apm compatibility support which
		# does not work with apmd.
		if [ ! -e /dev/apmctl ]; then
			warn "/dev/apmctl not found; kernel is missing apm(4)"
		fi
		;;
	*)
		return 1
		;;
	esac
}

load_rc_config $name
run_rc_command "$1"