config/scripts/0.start_dls.sh

42 lines
967 B
Bash
Raw Normal View History

#!/bin/bash
#
2023-05-24 18:12:07 +00:00
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
2023-05-24 18:12:07 +00:00
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 \
2023-05-24 18:12:07 +00:00
-v .:/var/lib/direktil \
$DLS_IMG &
# -auto-unlock 'N0v!T'
2023-05-24 18:12:07 +00:00
sleep 2
}
2023-05-24 18:12:07 +00:00
source $(dirname $0)/.common
check_root
prereqs
prereqs_dls
2023-05-24 18:12:07 +00:00
dir2config
start_store
unlock_store