srvrco / getssl

obtain free SSL certificates from letsencrypt ACME server Suitable for automating the process on remote servers.
GNU General Public License v3.0
2.08k stars 373 forks source link

problem calling new version; output of ... was "getssl.sh V2.46", expected "getssl V2.46" #751

Open mpaolo opened 2 years ago

mpaolo commented 2 years ago

Hi

weird, at some point cron run broke with msg:

problem calling new version; output of /tmp/tmp.67fngmEEyF -v was "getssl.sh V2.46", expected "getssl V2.46"

the cron script is simply

/root/.getssl/getssl.sh -u -a $@

it's run with no more args usually, guess that renaming getssl.sh as getssl fixes it, but it's been this way (getssl.sh) since 2018 working fine, so wonder if that's due to any recent change that makes it picky on shell script name too?

thx

outoftheblue9 commented 2 years ago

I was getting the same error. I manually updated the version to 2.46. It seems the script running on the machine needs to be called getssl not getssl.sh for the auto update to work. Try renaming the file and see if it works.

mpaolo commented 2 years ago

...Try renaming the file and see if it works.

yes did the same in the meantime, I see the strict test on the string seems was introduced in pull 719.

not big deal provided it's documented, though may break auto-updates from eg cron (my case). I'd rather use a fingerprint check though, like:

in getssl:

MD5=
check=$(grep -v ^MD5= $0|md5sum |cut -d" " -f1)
[ "$MD5" != $check ] && echo Nok && exit 1 || echo ok

a release script would "pre-stamp" it duly:

MD5=$(grep -v ^MD5= getssl|md5sum |cut -d" " -f1)
sed -i s/^MD5=.*/MD5=$MD5/ getssl

thx