> Hi Anthony.
>
> Thanks for the patch.
> Slightly modified version but it should do the same.
> Does this work for you?
>
> Index: rcctl.sh
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rcctl/rcctl.sh,v
> retrieving revision 1.116
> diff -u -p -r1.116 rcctl.sh
> --- rcctl.sh 24 Apr 2023 14:31:15 -0000 1.116
> +++ rcctl.sh 13 Jul 2023 09:58:39 -0000
> @@ -535,13 +535,17 @@ case ${action} in
> shift 1
> svcs="$*"
> [ -z "${svcs}" ] && usage
> - # it's ok to disable a non-existing daemon
> - if [ "${action}" != "disable" ]; then
> - for svc in ${svcs}; do
> + for svc in ${svcs}; do
> + # it's ok to disable a non-existing daemon
> + if [ "${action}" != "disable" ]; then
> svc_is_avail ${svc} || \
> rcctl_err "service ${svc} does not
> exist" 2
>- done
>- fi
> + # but still check for bad input
> + else
> + _rc_check_name "${svc}" || \
> + rcctl_err "service ${svc} does not
> exist" 2
> + fi <<< TRAILING WHITESPACE >>>
> + done
> [...snip...]
That works, but note the trailing whitespace after the "fi" in the
second-last line of the code snippet above.
Thanks,
Anthony