20 lines
615 B
Bash
20 lines
615 B
Bash
|
#!/bin/bash
|
||
|
CONFIG_FILE="${HOME}/.config/get_youtube_videos.conf"
|
||
|
cd "__src_folder__" || exit 1
|
||
|
if [ -r "${CONFIG_FILE}" ]; then
|
||
|
perms=$(stat -c %A "${CONFIG_FILE}")
|
||
|
if [ "${perms:4:6}" != '------' ]; then
|
||
|
echo "Permissions too open for config file '${CONFIG_FILE}' ($perms). Remove all permissions to group and others."
|
||
|
exit 1
|
||
|
fi
|
||
|
config=(--config "${CONFIG_FILE}")
|
||
|
else
|
||
|
config=()
|
||
|
fi
|
||
|
"__src_folder__/get_youtube_videos.sh" "${config[@]}" "${@}"
|
||
|
|
||
|
download_dir="${HOME}/downloaded_youtube_videos"
|
||
|
# shellcheck disable=SC1090
|
||
|
source "${CONFIG_FILE}"
|
||
|
chmod 0777 "${download_dir}" -R
|