generate-cert.sh 385 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. # Script generates certificate by default into the ~/trilium-data/cert where it is expected by Trilium
  3. # If directory is given in argument, certificate will be created there.
  4. if [ $# -eq 0 ]
  5. then
  6. DIR=~/trilium-data/cert
  7. else
  8. DIR=$1
  9. fi
  10. mkdir -p "$DIR"
  11. cd "$DIR"
  12. openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.crt -keyout key.key