Problem with periodically done scripts

Vitali Malicky life at zone3000.net
Fri Jul 25 11:52:12 PDT 2003



> I'm asking again, as there is no response up now.

You forgot to say "please", sir...  8-|

>
> As for me, now it seems as.... I don't know what's the error here, I have
> never seen that listings (using -x switch).

try my scripts, I never have any problems with them, so don't even understan
what you're about...

300.chkuid0
=========
#!/bin/sh -
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

case "$daily_status_security_chkuid0_enable" in
    [Yy][Ee][Ss])
        echo ""
        echo 'Checking for uids of 0:'
        n=$(awk -F: '/^#/ {next} $3==0 {print $1,$3}' /etc/master.passwd |
        tee /dev/stderr |
        sed -e '/^root 0$/d' -e '/^toor 0$/d' |
        wc -l)
        [ $n -gt 0 ] && rc=1 || rc=0;;
    *)  rc=0;;
============

400.passwdless
============
#!/bin/sh -
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

case "$daily_status_security_passwdless_enable" in
    [Yy][Ee][Ss])
        echo ""
        echo 'Checking for passwordless accounts:'
        n=$(awk -F: 'NF > 1 && $1 !~ /^[#+-]/ && $2=="" {print $0}'
/etc/master.passwd |
            tee /dev/stderr | wc -l)
        [ $n -gt 0 ] && rc=1 || rc=0;;
    *)  rc=0;;
esac

exit "$rc"


===========================




>
> Peter Rosa
>
>
>
> ----- Original Message -----
> From: "Peter Rosa" <prosa at pro.sk>
> To: <dan at slightlystrange.org>
> Cc: "freebsd-questions" <freebsd-questions at freebsd.org>
> Sent: Friday, July 25, 2003 6:59 PM
> Subject: Re: Problem with periodically done scripts
>
>
> > Here is complete listing. Do you have any idea ?
> >
> > + echo Checking for uids of 0:
> > Checking for uids of 0:
> > + awk -F: $3==0 {print $1,$3} /etc/master.passwd
> > + tee /dev/stderr
> > root 0
> > toor 0
> > + sed -e /^root 0$/d -e /^toor 0$/d
> > + wc -l
> > + n=
> > + [ -gt 0 -a -lt 1 ]
> > [: 0: unexpected operator
> > + echo Checking for passwordless accounts:
> > Checking for passwordless accounts:
> > + awk -F: NF > 1 && $1 !~ /^[#+-]/ && $2=="" {print $0}
/etc/master.passwd
> > + tee /dev/stderr
> > + wc -l
> > + n=
> > + [ -gt 0 -a -lt 1 ]
> > [: 0: unexpected operator
> >
> >
> > Peter Rosa
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list