question about script in freebsd14.2 ?

dear all :
I have read one script for build service in below, this script will load termatrix program when system boot. that was some master of FreeBSD told me. But I don't know every line means. Can you explain it for me? Thanks.
Code:
#!/bin/sh
# PROVIDE: termatrix
. /etc/rc.subr                                   #  what means ?
name="termatrix"                           # looks like define value. 
start_cmd="termatrix_start"            # ?
termatrix_start()                              #looks like some function 
{
sh -c 'exec /usr/local/bin/termatrix <> /dev/ttyv0 >&0 2>&1'                    #this line was very complex for me . please show me detail. thanks. 
}

load_rc_config $name                 # ?
run_rc_command "$1"                 # ?

thanks.
 
Back
Top