diff --git a/wrapper.sh b/wrapper.sh index 5d200f3..a1ffc6d 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -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