Home | History | Annotate | Line # | Download | only in rc.d
      1 #!/bin/sh
      2 #
      3 # $NetBSD: rcorder_cache,v 1.1 2026/08/20 14:43:32 thorpej Exp $
      4 #
      5 
      6 # KEYWORD: nostart
      7 
      8 $_rc_subr_loaded . /etc/rc.subr
      9 
     10 name=rcorder_cache
     11 rcvar=$name
     12 start_cmd=:
     13 stop_cmd=:
     14 reload_cmd=rcorder_cache_reload
     15 restart_cmd=:
     16 status_cmd=rcorder_cache_status
     17 poll_cmd=:
     18 
     19 extra_commands="reload status"
     20 
     21 rcorder_cache_reload()
     22 {
     23 	_rc_order_build_list
     24 	_rc_order_save_cache
     25 }
     26 
     27 rcorder_cache_status()
     28 {
     29 	if checkyesno "${rcvar}"; then
     30 		if [ -f /etc/rcorder.cache ]; then
     31 			printf '/etc/rcorder.cache is in use.\n'
     32 		else
     33 			printf '/etc/rcorder.cache will be built on next boot.\n'
     34 		fi
     35 		return 0
     36 	else
     37 		printf '/etc/rcorder.cache is not in use.\n'
     38 		return 1
     39 	fi
     40 }
     41 
     42 load_rc_config "$name"
     43 run_rc_command "$1"
     44