40scripts/certs2-40.sh

25 lines
657 B
Bash
Raw Normal View History

2023-03-11 20:07:32 +00:00
#!/bin/sh
set -e
2023-03-14 00:09:32 +00:00
ssh_host="admin@fg.dafu.dev"
ssh_opts="-p 11422 -i /root/.ssh/id_ed25519"
2023-03-11 20:07:32 +00:00
certname=fg.dafu.dev
key=$(cat /mnt/docker/volumes/caddy_caddy_data/_data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${certname}/${certname}.key)
crt=$(cat /mnt/docker/volumes/caddy_caddy_data/_data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${certname}/${certname}.crt)
2023-03-14 00:09:32 +00:00
. /root/repo/40scripts/util.sh
2023-03-11 20:07:32 +00:00
fg_set_cert_script="
execute batch start
config vpn certificate local
edit ${certname}
set private-key \"${key}\"
set certificate \"${crt}\"
end
execute batch end
"
2023-03-14 00:09:32 +00:00
# execute batch lastlog
2023-03-11 20:07:32 +00:00
run_ssh_script "${fg_set_cert_script}"