Fernando de Oliveira wrote:
> Ok, I do not remember why, I was thinking that date was the source of the
> error.
>
> Then as you asked,
>
> $ date -d "Dec 31 14:10:36 2040 GMT" +%Y%m%d
> date: data inválida "Dec 31 14:10:36 2040 GMT"
>
> The consequence, as you probably already know, is an empty string $certdate:
>
> certdate=$( date -d "${date}" +%Y%m%d 2>/dev/null )
> if [ "${certdate}x" = "x" ]; then echo "${cert}"; fi
This statement changes the $? element below.
> # Test for date problems > 2038 on 32-bit systems
> if [ $? = 0 ]; then continue; fi
I think this should be !=
> if [ ${certdate} -lt ${today} ]; then
> echo "${cert} is expired! Removing..."
> rm -f "${cert}"
> fi
>
> gives, running the complete for .. done loop:
>
> certs/0c4c9b6c.pem
> certs/c47d9980.pem
> certs/9c8dfbd4.pem
> certs/b727005e.pem
>
> I am going to test the scripts in other machines (distros, including a 64bit).
I'd think it would be the same. After all, certs that expire in 2040
are not expired yet.
-- Bruce
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page