mirror of
				https://src.koozali.org/infra/smeserver-koji.git
				synced 2025-10-30 22:01:25 +01:00 
			
		
		
		
	fix gencert without param 2 error
This commit is contained in:
		| @@ -3,16 +3,17 @@ | |||||||
|  |  | ||||||
| set -e | set -e | ||||||
| KOJI_USER="$1" | KOJI_USER="$1" | ||||||
| CERT_SUBJECT="$2" |  | ||||||
|  |  | ||||||
| DEBUG= | DEBUG= | ||||||
| SILENT="-s" | SILENT="-s" | ||||||
| QUIET="-q" | QUIET="-q" | ||||||
| for param in $3 ; do | for param in $2 $3 ; do | ||||||
|   if [ $param ] ; then |   if [ $param ] ; then | ||||||
|     case $param in |     case $param in | ||||||
| 	    debug ) | 	    debug ) | ||||||
| 		    DEBUG="debug" ;; | 		    DEBUG="debug" ;; | ||||||
|  |       * ) | ||||||
|  |         CERT_SUBJECT="$2" ;; | ||||||
|     esac |     esac | ||||||
|   else |   else | ||||||
| 	  break | 	  break | ||||||
| @@ -27,7 +28,8 @@ fi | |||||||
|  |  | ||||||
| openssl genrsa -out private/"$KOJI_USER".key 2048 | openssl genrsa -out private/"$KOJI_USER".key 2048 | ||||||
| if [ -z "$CERT_SUBJECT" ]; then | if [ -z "$CERT_SUBJECT" ]; then | ||||||
| 	openssl req -config ssl.cnf -new -nodes -out certs/"$KOJI_USER".csr -key private/"$KOJI_USER".key |   cat ssl.cnf | sed "s/$HOSTNAME/'${user}'/"> ssl2.cnf | ||||||
|  | 	openssl req -config ssl2.cnf -new -nodes -out certs/"$KOJI_USER".csr -key private/"$KOJI_USER".key | ||||||
| else | else | ||||||
| 	openssl req -subj "$CERT_SUBJECT" -config ssl.cnf -new -nodes -out certs/"$KOJI_USER".csr -key private/"$KOJI_USER".key | 	openssl req -subj "$CERT_SUBJECT" -config ssl.cnf -new -nodes -out certs/"$KOJI_USER".csr -key private/"$KOJI_USER".key | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Trevor Batley
					Trevor Batley