29 lines
633 B
Desktop File
29 lines
633 B
Desktop File
[Unit]
|
|
Description=%p-%i
|
|
|
|
# Requirements
|
|
Requires=mysql@%i.service
|
|
Requires=web@%i.service
|
|
|
|
# Dependency ordering
|
|
After=mysql@%i.service
|
|
Before=web@%i.service
|
|
|
|
# Dependency binding
|
|
BindsTo=web@%i.service
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
EnvironmentFile=/data/domains/%i/.env
|
|
ExecStart=/bin/bash -euxc ' \
|
|
application_folder=/data/domains/%i/${APPLICATION}; \
|
|
if [ ! -d $application_folder ]; then \
|
|
mkdir -p $application_folder; \
|
|
touch $application_folder/.htaccess; \
|
|
cat /data/domains/%i/mysql/.env | sed s/MYSQL_PASS/DB_PASS/ > $application_folder/.env; \
|
|
fi;'
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|