3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-25 13:29:29 +01:00
pbot/Docker/entrypoint.sh

29 lines
805 B
Bash
Raw Normal View History

2024-04-01 00:16:25 +02:00
#!/bin/bash
# File: entrypoint.sh
# Purpose: Docker/Podman/etc entry-point. Ensures user has mounted data, etc.
# SPDX-FileCopyrightText: 2001-2023 Pragmatic Software <pragma78@gmail.com>
# SPDX-License-Identifier: MIT
if ! mountpoint -q /opt/pbot/persist-data; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You did not specify a location on the host machine
to store your data. This means NOTHING will persist
if this docker container is deleted or updated, such
as factoids, message history, users, bans, etc.
In other words, you will LOSE YOUR DATA!
Run the container with the -v option:
docker ... -v /path/to/your/data/:/opt/pbot/persist-data
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi
cd /opt/pbot/
exec bin/pbot data_dir=persist-data "$@"