Subversion Repositories ALCASAR

Rev

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

Rev 2554 Rev 2813
Line 39... Line 39...
39
	#  Export of CA Certificate
39
	#  Export of CA Certificate
40
	cd /root
40
	cd /root
41
	tar cvf $FILE.tar $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
41
	tar cvf $FILE.tar $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
42
 
42
 
43
	#  Export of server Certificate
43
	#  Export of server Certificate
44
	tar rvf $FILE.tar $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,certs/server-chain.crt}
44
	tar rvf $FILE.tar $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,certs/server-chain.pem}
45
	gzip $FILE.tar
45
	gzip $FILE.tar
46
	echo "Le fichier des certificats exportés est : $FILE.tar.gz"
46
	echo "Le fichier des certificats exportés est : $FILE.tar.gz"
47
} # end function export
47
} # end function export
48
 
48
 
49
 
49
 
Line 58... Line 58...
58
 
58
 
59
	#  Save of server Certificate
59
	#  Save of server Certificate
60
	cd $DIR_PKI/tls
60
	cd $DIR_PKI/tls
61
	cp certs/alcasar.crt $DIR_SAVE/.
61
	cp certs/alcasar.crt $DIR_SAVE/.
62
	cp private/alcasar.key $DIR_SAVE/.
62
	cp private/alcasar.key $DIR_SAVE/.
63
	cp certs/server-chain.crt $DIR_SAVE/.
63
	cp certs/server-chain.pem $DIR_SAVE/.
64
} # end function archive
64
} # end function archive
65
 
65
 
66
function import() {
66
function import() {
67
	echo "Would you like to Import New Certificates in ALCASAR ?"
67
	echo "Would you like to Import New Certificates in ALCASAR ?"
68
	read response
68
	read response
Line 77... Line 77...
77
		(cat $DIR_PKI/tls/private/alcasar.key; echo; cat $DIR_PKI/tls/certs/alcasar.crt) > $DIR_PKI/tls/private/alcasar.pem
77
		(cat $DIR_PKI/tls/private/alcasar.key; echo; cat $DIR_PKI/tls/certs/alcasar.crt) > $DIR_PKI/tls/private/alcasar.pem
78
 
78
 
79
		echo "Import new certificates in ALCASAR !!!"
79
		echo "Import new certificates in ALCASAR !!!"
80
		cp -r $DIR_IMPORT/* /.
80
		cp -r $DIR_IMPORT/* /.
81
		chown root:apache $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
81
		chown root:apache $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
82
		chown root:apache $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,private/alcasar.pem,certs/server-chain.crt}
82
		chown root:apache $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,private/alcasar.pem,certs/server-chain.pem}
83
 
83
 
84
		chmod 750 $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
84
		chmod 750 $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
85
		chmod 750 $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,private/alcasar.pem,certs/server-chain.crt}
85
		chmod 750 $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,private/alcasar.pem,certs/server-chain.pem}
86
 
86
 
87
		service lighttpd restart
87
		service lighttpd restart
88
	else
88
	else
89
		echo "You are not import new certificates !!!"
89
		echo "You are not import new certificates !!!"
90
		exit 0
90
		exit 0