41 lines
939 B
Bash
Executable File
41 lines
939 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
|
|
prereqs_dls() {
|
|
command -v docker 1>/dev/null || perror "Docker is needed, please install it and run again."
|
|
systemctl is-active docker &>/dev/null || systemctl start docker
|
|
docker pull $DLS_IMG
|
|
}
|
|
|
|
dir2config() {
|
|
pinfo "Generating config.yaml from Direktil configuration"
|
|
docker run --rm --name $D2C_CTR_NAME \
|
|
-v .:/var/lib/direktil -w /var/lib/direktil \
|
|
--entrypoint=/bin/dkl-dir2config \
|
|
$D2C_IMG
|
|
}
|
|
|
|
start_store() {
|
|
if docker ps|grep " $DLS_CTR_NAME$" &>/dev/null; then
|
|
pinfo "Container $DLS_CTR_NAME seems already running"
|
|
return
|
|
fi
|
|
docker run --rm --name $DLS_CTR_NAME -p 7606:7606 \
|
|
-e http_proxy=$http_proxy \
|
|
-e https_proxy=$https_proxy \
|
|
-e HTTP_PROXY=$HTTP_PROXY \
|
|
-e HTTPS_PROXY=$HTTPS_PROXY \
|
|
-v .:/var/lib/direktil \
|
|
$DLS_IMG &
|
|
sleep 2
|
|
}
|
|
|
|
source $(dirname $0)/.common
|
|
check_root
|
|
prereqs
|
|
prereqs_dls
|
|
dir2config
|
|
start_store
|
|
unlock_store
|
|
|