trashposs/docs/examples/Podman (quadlet)/volume-dir-creation.sh

25 lines
1011 B
Bash
Raw Normal View History

#!/bin/bash
if [ -d $HOME/.config/containers/systemd ]; then
2024-04-06 23:55:59 +02:00
mkdir -pv $(grep -F "Volume=" $HOME/.config/containers/systemd/trashposs-*.container | sed "s|%h|$HOME|g" | cut -d= -f2 | cut -d: -f1);
2024-04-06 23:55:59 +02:00
db_env=$(grep -F "EnvironmentFile=" $HOME/.config/containers/systemd/trashposs-db.container | sed "s|%h|$HOME|g" | cut -d= -f2)
config_dir=$(grep -F ":/trashposs/.config" $HOME/.config/containers/systemd/trashposs-web.container | sed "s|%h|$HOME|g" | cut -d= -f2 | cut -d: -f1)
if [ ! -f $config_dir/docker_example.env ]; then
wget -O $db_env \
2024-04-06 22:37:46 +02:00
https://iceshrimp.dev/Crimekillz/trashposs/raw/branch/dev/.config/docker_example.env;
else
cp -v $config_dir/docker_example.env $db_env;
fi
if [ ! -f $config_dir/example-docker.yml ]; then
wget -O $config_dir/default.yml \
2024-04-06 22:37:46 +02:00
https://iceshrimp.dev/Crimekillz/trashposs/raw/branch/dev/.config/example-docker.yml;
else
cp $config_dir/example-docker.yml $config_dir/default.yml
fi
else
echo "No $HOME/.config/containers/systemd found"
exit 1
fi