fix home for systemd

This commit is contained in:
Antonio J. Delgado 2024-11-19 12:33:36 +02:00
parent ba08dd2f8f
commit 528aced689

View file

@ -1,4 +1,12 @@
#!/bin/bash
if [ -z "${HOME}" ]; then
if [ "$(whoami)" == "root" ]; then
HOME="/root"
else
HOME=$(grep "$(whoami)" /etc/passwd | awk 'BEGIN {FS=":"} {print($6)}')
fi
fi
CONFIG_FILE="${HOME}/.config/get_peertube_videos.conf"
cd "__src_folder__" || exit 1
if [ -r "${CONFIG_FILE}" ]; then