This repository has been archived on 2024-02-04. You can view files and clone it, but cannot push or open issues or pull requests.
flox-dockerized/rootfs/etc/cont-init.d/50-init

20 lines
488 B
Text

#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# source env variables
source /etc/cont-init.d/20-setenv
# check if lock file is present
if [[ ! -f /flox/.lock ]]; then
# move app to permanent path
printf 'Copying files to bind mount path\n'
rsync --archive --delete --backup --backup-dir=/tmp /app/flox/ /flox
# create lock file to prevent overwriting existing files
touch /flox/.lock
chmod 600 /flox/.lock
else
printf 'Lock file present. Not copying files\n'
fi