#!/bin/sh ################################################################################ # caab1403.sh # ################################################################################ # # implements full compliance with CA AB1403 # # see: https://legiscan.com/CA/text/AB1043/2025 ################################################################################ # interpreting output # ################################################################################ # # an age bracket check will return one of the following values: # # A : the user claims to be less than 13 years old # B : the user claims to be more than 13 and less than 16 years old # C : the user claims to be more than 16 and less than 18 years old # D : the user claims to be more than 18 years old # : the user declines to participate ################################################################################ # copyright # ################################################################################ # # this file is copyright 2026 by spike@full0fstars.net # # it may be used and redistributed in any way provided this attribution # information is included usage() { echo "Usage: $0 [-s age] [-c]" echo "" echo "Options:" echo " -s age sets the current user's age" echo " -c checks the current user's age bracket" exit 1 } AGE="" CHECK="" while getopts ":s:ch" opt; do case $opt in s) AGE="$OPTARG" ;; c) CHECK="true" ;; h) usage ;; \?) echo "Error: Invalid option -$OPTARG" >&2; usage ;; :) echo "Error: Option -$OPTARG requires an argument" >&2; usage ;; esac done if [ "" != "$AGE" ] then if [ 13 -gt "$AGE" ] then echo "A" > ~/.caab1403_bracket elif [ 16 -gt "$AGE" ] then echo "B" > ~/.caab1403_bracket elif [ 18 -gt "$AGE" ] then echo "C" > ~/.caab1403_bracket else echo "D" > ~/.caab1403_bracket fi fi if [ "" != "$CHECK" ] then cat ~/.caab1403_bracket fi