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