#!/usr/bin/env bash ############################################################# # Script name: install.sh # Author: Gilles Mouchet (gilles.mouchet@gmail.com # Version: 1.0.0 # Description: This script prepare own pki environment # License: GNU GPL v3 # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # Changelog # [1.0.0] - 2026-04-12 # - Added # - create environment for cert # - create DB # - Project initialization # - initialization by gilles.mouchet@gmail.com # ############################################################ # set -Eeuo pipefail VERSION=1.0.0 # path resolution # scripts and lib SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_DIR="$(dirname "$SCRIPT_DIR")" # database DB_PATH=/var/lib/own-pki/certificates.db ############################################################ # FUNCTIONS ############################################################ #----------------------------------------------------------- # init db init_db(){ mkdir -p "$(dirname "$DB_PATH")" } ############################################################ # Main ############################################################ # path resolution SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_DIR="$(dirname "$SCRIPT_DIR")" echo $SCRIPT_DIR echo $ROOT_DIR