Subversion Repositories ALCASAR

Rev

Rev 2454 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2454 Rev 2488
Line 41... Line 41...
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.crt}
45
	gzip $FILE.tar
45
	gzip $FILE.tar
46
	echo "Le ficher 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
 
50
function archive() {
50
function archive() {
51
	# Sauvegarde de la pki actuelle
51
	# Sauvegarde de la pki actuelle
Line 71... Line 71...
71
		[ -d $DIR_IMPORT ] || mkdir $DIR_IMPORT
71
		[ -d $DIR_IMPORT ] || mkdir $DIR_IMPORT
72
		rm -rf $DIR_IMPORT/*
72
		rm -rf $DIR_IMPORT/*
73
 
73
 
74
		#  Import of CA Certificate
74
		#  Import of CA Certificate
75
		tar xzvf $1 --directory=$DIR_IMPORT
75
		tar xzvf $1 --directory=$DIR_IMPORT
-
 
76
		cat $DIR_PKI/tls/private/alcasar.key $DIR_PKI/tls/certs/alcasar.crt > $DIR_PKI/tls/private/alcasar.pem
76
		echo "Import new certificates in ALCASAR !!!"
77
		echo "Import new certificates in ALCASAR !!!"
77
		cp -r $DIR_IMPORT/* /.
78
		cp -r $DIR_IMPORT/* /.
78
		chown root:apache $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
79
		chown root:apache $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
79
		chown root:apache $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,certs/server-chain.crt}
80
		chown root:apache $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,private/alcasar.pem,certs/server-chain.crt}
80
 
81
 
81
		# Service apache restart
82
		chmod 750 $DIR_PKI/CA/{alcasar-ca.crt,private/alcasar-ca.key}
-
 
83
		chmod 750 $DIR_PKI/tls/{certs/alcasar.crt,private/alcasar.key,private/alcasar.pem,certs/server-chain.crt}
-
 
84
 
82
		service httpd restart
85
		service lighttpd restart
83
	else
86
	else
84
		echo "You are not import new certificates !!!"
87
		echo "You are not import new certificates !!!"
85
		exit 0
88
		exit 0
86
	fi
89
	fi
87
} # end import
90
} # end import