#!/bin/sh
/パス/certbot \
renew \
--standalone \
--pre-hook "/パス/apache24 stop" \
--post-hook "/パス/apache24 start"
F1=/パス/ns.sing.ne.jp/cert.pem
F2=/パス/cert.pem
CHANGE=FALSE
if [ ! -f $F1 ]; then
echo "file not found $F1"
exit 1
fi
if [ ! -f $F2 ]; then
echo "file not found $F2"
CHANGE=TRUE
else
if [ $F1 -nt $F2 ]; then
CHANGE=TRUE
fi
fi
if [ $CHANGE = "TRUE" ]; then
cat /パス/ns.sing.ne.jp/privkey.pem > $F2
cat /パス/ns.sing.ne.jp/fullchain.pem >> $F2
fi