#!/bin/sh

# store previous and new values
PA=$(sysctl -n kern.audio.record)
PV=$(sysctl -n kern.video.record)
NA=$1
NV=$2

case $1 in
    [01]) doas sysctl -q kern.audio.record=$1;
        ;;
    r) doas rcctl restart sndiod;
        ;;
esac

case $2 in
    [01]) doas sysctl -q kern.video.record=$2; ;;
esac

printf 'REC:%s CAM:%s\n' \
           $(sysctl -n kern.audio.record) \
           $(sysctl -n kern.video.record)
