Subversion Repositories ALCASAR

Rev

Rev 2488 | Rev 2688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2488 Rev 2554
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# $Id: alcasar-importcert.sh 2488 2018-02-25 14:53:54Z lucas.echard $
3
# $Id: alcasar-importcert.sh 2554 2018-05-20 11:02:46Z lucas.echard $
4
#
4
#
5
# alcasar-importcert.sh
5
# alcasar-importcert.sh
6
# by Raphaël, Hugo, Clément, Bettyna & rexy
6
# by Raphaël, Hugo, Clément, Bettyna & rexy
7
#
7
#
8
# This script is distributed under the Gnu General Public License (GPL)
8
# This script is distributed under the Gnu General Public License (GPL)
Line 38... Line 38...
38
	mv -f $DIR_CERT/private/alcasar.key.old $DIR_CERT/private/alcasar.key
38
	mv -f $DIR_CERT/private/alcasar.key.old $DIR_CERT/private/alcasar.key
39
	if [ -f $DIR_CERT/certs/server-chain.crt.old ]
39
	if [ -f $DIR_CERT/certs/server-chain.crt.old ]
40
	then
40
	then
41
		mv $DIR_CERT/certs/server-chain.crt.old $DIR_CERT/certs/server-chain.crt
41
		mv $DIR_CERT/certs/server-chain.crt.old $DIR_CERT/certs/server-chain.crt
42
	fi
42
	fi
-
 
43
	
43
	cat $DIR_CERT/private/alcasar.key $DIR_CERT/certs/alcasar.crt > $DIR_CERT/private/alcasar.pem
44
	(cat $DIR_CERT/private/alcasar.key; echo; cat $DIR_CERT/certs/alcasar.crt) > $DIR_CERT/private/alcasar.pem
-
 
45
 
44
	chown root:apache $DIR_CERT/private/alcasar.pem
46
	chown root:apache $DIR_CERT/private/alcasar.pem
45
	chmod 750 $DIR_CERT/private/alcasar.pem
47
	chmod 750 $DIR_CERT/private/alcasar.pem
46
}
48
}
47
 
49
 
48
function domainName() # change the domain name in the conf files
50
function domainName() # change the domain name in the conf files
Line 81... Line 83...
81
		mv $DIR_CERT/private/alcasar.key $DIR_CERT/private/alcasar.key.old
83
		mv $DIR_CERT/private/alcasar.key $DIR_CERT/private/alcasar.key.old
82
	fi
84
	fi
83
 
85
 
84
	cp $cert $DIR_CERT/certs/alcasar.crt
86
	cp $cert $DIR_CERT/certs/alcasar.crt
85
	cp $key $DIR_CERT/private/alcasar.key
87
	cp $key $DIR_CERT/private/alcasar.key
-
 
88
 
86
	cat $DIR_CERT/private/alcasar.key $DIR_CERT/certs/alcasar.crt > $DIR_CERT/private/alcasar.pem
89
	(cat $DIR_CERT/private/alcasar.key; echo; cat $DIR_CERT/certs/alcasar.crt) > $DIR_CERT/private/alcasar.pem
87
 
90
 
88
	chown root:apache $DIR_CERT/certs/alcasar.crt
91
	chown root:apache $DIR_CERT/certs/alcasar.crt
89
	chown root:apache $DIR_CERT/private/alcasar.key
92
	chown root:apache $DIR_CERT/private/alcasar.key
90
	chown root:apache $DIR_CERT/private/alcasar.pem
93
	chown root:apache $DIR_CERT/private/alcasar.pem
91
 
94