25 lines
699 B
Bash
25 lines
699 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
||
|
# license: MIT
|
||
|
|
||
|
# this script is used in a systemd service file (wanted by other services)
|
||
|
|
||
|
[[ "$EUID" != 0 ]] && printf "error: permission denied!\n" && exit 1
|
||
|
|
||
|
printf "preparing filesystem...\n"
|
||
|
|
||
|
if [[ ! -d "/var/log/pveproxy" ]]; then
|
||
|
printf "creating directory '/var/log/pveproxy' with owner 'www-data'...\n"
|
||
|
mkdir -p /var/log/pveproxy
|
||
|
chown -R www-data:www-data /var/log/pveproxy
|
||
|
fi
|
||
|
|
||
|
if [[ ! -d "/var/log/nginx" ]]; then
|
||
|
printf "creating directory '/var/log/nginx' with owner 'www-data'...\n"
|
||
|
mkdir -p /var/log/nginx
|
||
|
chown -R www-data:www-data /var/log/nginx
|
||
|
fi
|
||
|
|
||
|
printf "finished preparing the filesystem!\n"
|