diff --git a/wrapper.sh b/wrapper.sh index c0e17a0..31ff011 100644 --- a/wrapper.sh +++ b/wrapper.sh @@ -1,4 +1,11 @@ #!/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_youtube_videos.conf" cd "__src_folder__" || exit 1 if [ -r "${CONFIG_FILE}" ]; then