BASH
207
if ne 1 a ne 2 then echo usage 0 path to ssl dhparams pem 1024
Guest on 28th November 2024 07:11:11 AM
- #!/bin/bash
- if [ $# -ne 1 -a $# -ne 2 ]; then echo "Usage: $0 </path/to/ssl-dhparams.pem> [1024, 2048 or 4096]"; exit 1; fi
- if [ "x$2" == "x" ]; then
- BITS=4096;
- else
- if [ $2 -ne 1024 -a $2 -ne 2048 -a $2 -ne 4096 ]; then echo "Bits should be 1024, 2048 or 4096"; exit 1; fi
- BITS=$2;
- fi
- openssl dhparam -out $1 $BITS
Raw Paste