#!/bin/sh -x SRC_DIR=`cd ../.. ; pwd` INSTANCE_NAME=pki-ca pkicreate -pki_instance_root=/var/lib \ -pki_instance_name=$INSTANCE_NAME \ -subsystem_type=ca \ -secure_port=9443 \ -unsecure_port=9180 \ -tomcat_server_port=9701 \ -user=pkiuser \ -group=pkiuser \ -redirect conf=/etc/$INSTANCE_NAME \ -redirect logs=/var/log/$INSTANCE_NAME \ -verbose ln -s /usr/share/tomcat6/bin /var/lib/$INSTANCE_NAME/bin ln -s /usr/share/tomcat6/lib /var/lib/$INSTANCE_NAME/lib rm -f /var/lib/$INSTANCE_NAME/webapps/ca/WEB-INF/lib/pki-* rm -rf /var/lib/$INSTANCE_NAME/webapps/ca/WEB-INF/classes cp -r $SRC_DIR/pki/build/classes /var/lib/$INSTANCE_NAME/webapps/ca/WEB-INF chown -R pkiuser.pkiuser /var/lib/$INSTANCE_NAME/webapps/ca/WEB-INF/classes systemctl restart pki-cad@$INSTANCE_NAME.service