1
0

refreshkeys.sh 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. keyList=(
  3. chainA-ICA1-key.pem chainA-entity-key.pem
  4. chainB-ICA2-key.pem chainB-ICA1-key.pem chainB-entity-key.pem
  5. chainC-ICA1-key.pem chainC-entity-key.pem
  6. chainD-ICA1-key.pem chainD-entity-key.pem
  7. chainE-ICA1-key.pem chainE-entity-key.pem
  8. chainF-ICA2-key.pem chainF-ICA1-key.pem chainF-entity-key.pem
  9. chainG-ICA7-key.pem chainG-ICA6-key.pem chainG-ICA5-key.pem
  10. chainG-ICA4-key.pem chainG-ICA3-key.pem chainG-ICA2-key.pem
  11. chainG-ICA1-key.pem chainG-entity-key.pem
  12. chainH-ICA4-key.pem chainH-ICA3-key.pem chainH-ICA2-key.pem
  13. chainH-ICA1-key.pem chainH-entity-key.pem
  14. chainI-ICA3-key.pem chainI-ICA2-key.pem chainI-ICA1-key.pem
  15. chainI-entity-key.pem
  16. chainJ-ICA4-key.pem chainJ-ICA3-key.pem chainJ-ICA2-key.pem
  17. chainJ-ICA1-key.pem chainJ-entity-key.pem
  18. )
  19. for TARGET_KEY in "${keyList[@]}"
  20. do
  21. if [ -f "$TARGET_KEY" ]; then
  22. printf '%s\n' "Removing $TARGET_KEY"
  23. rm "$TARGET_KEY"
  24. fi
  25. printf '%s\n' "Creating new $TARGET_KEY"
  26. openssl genrsa -out "$TARGET_KEY" 2048
  27. done