summaryrefslogtreecommitdiff
path: root/net/sipxcommserverlib/files/patch-bin_ssl-cert_gen-ssl-keys.sh.in
blob: e3bd3f563b9186a90e47b70bf228039eb45e2a08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- ./bin/ssl-cert/gen-ssl-keys.sh.in.orig	Sat Dec 30 16:45:06 2006
+++ ./bin/ssl-cert/gen-ssl-keys.sh.in	Sat Dec 30 16:45:55 2006
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/local/bin/bash
 ##
 ##  gen-ssl-keys.sh - generate SSL key and certificate files.
 ##
@@ -33,7 +33,8 @@
 openssl="@OPENSSL@"
 
 # default base name for ca and its files
-caName=ca.`hostname --domain`
+dom=`hostname | sed 's/[^\.]*\.\(.*\)/\1/'`
+caName=ca.$dom
 
 # if there is a file of saved default answers for the questions, read them
 Defaults=SSL_DEFAULTS
@@ -207,14 +208,15 @@
 
 EOF
 
-    askfor sipDomainName "SIP domain name" `hostname --domain` 
-    askfor server        "Full DNS name for the server" `hostname --fqdn` NOSTORE
+    dom=`hostname | sed 's/[^\.]*\.\(.*\)/\1/'`
+    askfor sipDomainName "SIP domain name" $dom
+    askfor server        "Full DNS name for the server" `hostname` NOSTORE
     while test ${caName} = ${server}
       do
       echo "" 1>&2
       echo "Error: The Server name must not be the same as the CA name." 1>&2
       server=""
-      askfor server "Server Common Name (DNS name for Server)" `hostname --fqdn` NOSTORE
+      askfor server "Server Common Name (DNS name for Server)" `hostname` NOSTORE
     done
 
     askfor serverEmail "Email Contact Address for Server (name@example.org)" "${caEmail}" NOSTORE