20 lines
No EOL
531 B
Bash
20 lines
No EOL
531 B
Bash
!/usr/bin/env fish
|
|
|
|
set cert_file ./mnt/in/priv-fullchain-bundle.pem
|
|
set pfx_file ./mnt/out/cert.pfx
|
|
set password $PFX_PASSWORD
|
|
|
|
# touch $cert_file
|
|
|
|
echo "pass: $password"
|
|
|
|
# Initial conversion
|
|
openssl pkcs12 -export -out $pfx_file -inkey $cert_file -in $cert_file -password pass:$password
|
|
|
|
# Watch for changes and convert
|
|
while true
|
|
inotifywait -e modify $cert_file
|
|
echo "refreshing key"
|
|
openssl pkcs12 -export -out $pfx_file -inkey $cert_file -in $cert_file -password pass:$password
|
|
sleep 1 # prevent failloop
|
|
end |