keyFile = "$target.key" crtFile = "$target.crt" csrFile = "$target.csr"
K0l0s0s, COE LPIC-1, NCLA, SCSA Linux Registered User # 373129 Philippines --- On Mon, 5/10/10, Camilo III Lozano <[email protected]> wrote: From: Camilo III Lozano <[email protected]> Subject: [klug] bash help To: "Kagay-Anon Linux Users' Group (KLUG) Mailing List" <[email protected]> Date: Monday, May 10, 2010, 12:07 AM i'm new to bash... trying to simplify generating ssl certs... but does not work... here's the code... #!/bin/bash umask 077 echo "" if [ $# -eq 0 ] ; then echo $"Usage: `basename $0` <DOMAIN_NAME> [...]" echo "" exit 0 fi for target in $@ ; do keyFile = ${target}.key crtFile = ${target}.crt csrFile = ${target}.csr echo $keyFile echo $crtFile echo $csrFile # Generate private key openssl genrsa -out $keyFile 1024 # Generate CSR openssl req -new -key $keyFile -out $csrFile echo "" echo "Please enter the number of days which SSL Certificate will be valid:" read DAYS echo "" # Generate Self Signed Key openssl x509 -req -days $DAYS -in $csrFile -signkey $keyFile -out $crtFile done and here's the result... [r...@localhost ~]# ./gencert sample.com ./gencert: line 13: domainName: command not found ./gencert: line 15: keyFile: command not found ./gencert: line 16: crtFile: command not found ./gencert: line 17: csrFile: command not found Generating RSA private key, 512 bit long modulus ......++++++++++++ .++++++++++++ e is 65537 (0x10001) Error opening Private Key -out 1217:error:02001002:system library:fopen:No such file or directory:bss_file.c:352:fopen('-out','r') 1217:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354: unable to load Private Key =================== anybody? -- ================== Mobile #: +63916-3338326 Telephone #: Iligan City: (+63)(63) 221-1122 Cagayan de Oro City: (088) 350-7211 St. Michael's College (SA) http://www.smciligan.edu.ph [email protected] http://www.kagayan.com http://dev.kagayan.com http://www.zabyer.org CdeO webby: - http://cdo.kagayan.com - http://cagayandeoro.kagayan.com ------- Got my Own Hacker Key: v3sw3BHhw5ln2pr5OFPck3ma2u4MLw5XVm+5l5UCi5Ne4t3b5en5g5RaIs5MSr3p2 http://www.hackerkey.com Registered Linux User: #439468 -----Inline Attachment Follows----- _________________________________________________ Kagay-Anon Linux Users' Group (KLUG) Mailing List [email protected] (http://lists.linux.org.ph/mailman/listinfo/klug) Searchable Archives: http://archives.free.net.ph
_________________________________________________ Kagay-Anon Linux Users' Group (KLUG) Mailing List [email protected] (http://lists.linux.org.ph/mailman/listinfo/klug) Searchable Archives: http://archives.free.net.ph
