GUI - Check .env file for set params
MODIFY
scripts/menus/config_folder_set.sh
scripts/menus/config_folder_set.sh
@@ -3,13 +3,18 @@ set -euo pipefail
IFS=$'\n\t'
config_folder_set() {
+
+ local ENVDOCCONFDIR
+ ENVDOCCONFDIR=$(run_script 'env_get' 'DOCKERCONFDIR')
+ ENVDOCCONFDIR="${ENVDOCCONFDIR:-"${DETECTED_HOMEDIR}/.docker/config"}"
+
if [[ ${CI:-} != true ]] && [[ ${TRAVIS:-} != true ]] && (whiptail --title "Configs Location" --fb --yesno \
- "The default place for config files is: ${DETECTED_HOMEDIR}/.docker/config\\nThis will be passed into the applications.\\n\\nWould you like to accept this?" 12 78); then
+ "The detected .env parameter or suggested place for config files is:\\n${ENVDOCCONFDIR}\\n\\nThis will be passed into the applications.\\n\\nWould you like to accept this?" 14 78); then
reset || true
#TODO - Check if the folder exists?
#TODO - Set permissions on the folder?
- run_script 'env_set' 'DOCKERCONFDIR' "${DETECTED_HOMEDIR}/.docker/config"
+ run_script 'env_set' 'DOCKERCONFDIR' "${ENVDOCCONFDIR}"
else
- run_menu 'input_prompt' 'DOCKERCONFDIR' "${DETECTED_HOMEDIR}/.docker/config"
+ run_menu 'input_prompt' 'DOCKERCONFDIR' "${ENVDOCCONFDIR}"
fi
}

MODIFY
scripts/menus/download_folder_set.sh
scripts/menus/download_folder_set.sh
@@ -3,13 +3,18 @@ set -euo pipefail
IFS=$'\n\t'
download_folder_set() {
+
+ local ENVDOWNLOADSDIR
+ ENVDOWNLOADSDIR=$(run_script 'env_get' 'DOWNLOADSDIR')
+ ENVDOWNLOADSDIR="${ENVDOWNLOADSDIR:-"${DETECTED_HOMEDIR}/Downloads"}"
+
if [[ ${CI:-} != true ]] && [[ ${TRAVIS:-} != true ]] && (whiptail --title "Dowloads Location" --fb --yesno \
- "The default place for download files is: ${DETECTED_HOMEDIR}/Downloads\\nThis will be passed into the applications.\\n\\nWould you like to accept this?" 12 78); then
+ "The default place for download files is:\\n${ENVDOWNLOADSDIR}\\n\\nThis will be passed into the applications.\\n\\nWould you like to accept this?" 14 78); then
reset || true
#TODO - Should we check if the folder exists?
#TODO - Should we set permissions on the folder?
- run_script 'env_set' 'DOWNLOADSDIR' "${DETECTED_HOMEDIR}/Downloads"
+ run_script 'env_set' 'DOWNLOADSDIR' "${ENVDOWNLOADSDIR}"
else
- run_menu 'input_prompt' 'DOWNLOADSDIR' "${DETECTED_HOMEDIR}/Downloads"
+ run_menu 'input_prompt' 'DOWNLOADSDIR' "${ENVDOWNLOADSDIR}"
fi
}

MODIFY
scripts/menus/media_folders_set.sh
scripts/menus/media_folders_set.sh
@@ -3,19 +3,36 @@ set -euo pipefail
IFS=$'\n\t'
media_folders_set() {
+
+ local ENVBOOKS
+ ENVBOOKS=$(run_script 'env_get' 'MEDIADIR_BOOKS')
+ ENVBOOKS="${ENVBOOKS:-"${DETECTED_HOMEDIR}/Books"}"
+
+ local ENVMOVIES
+ ENVMOVIES=$(run_script 'env_get' 'MEDIADIR_MOVIES')
+ ENVMOVIES="${ENVMOVIES:-"${DETECTED_HOMEDIR}/Movies"}"
+
+ local ENVMUSIC
+ ENVMUSIC=$(run_script 'env_get' 'MEDIADIR_MUSIC')
+ ENVMUSIC="${ENVMUSIC:-"${DETECTED_HOMEDIR}/Music"}"
+
+ local ENVTV
+ ENVTV=$(run_script 'env_get' 'MEDIADIR_TV')
+ ENVTV="${ENVTV:-"${DETECTED_HOMEDIR}/TV"}"
+
if [[ ${CI:-} != true ]] && [[ ${TRAVIS:-} != true ]] && (whiptail --title "Media Locations" --fb --yesno \
- "The default place for Media files is:\\n${DETECTED_HOMEDIR}/Books\\n${DETECTED_HOMEDIR}/Movies\\n${DETECTED_HOMEDIR}/Music\\n${DETECTED_HOMEDIR}/TV\\n\\nThis will be passed into the applications.\\n\\nWould you like to accept this?" 17 78); then
+ "The detected .env parameter or suggested place for Media files is:\\nBooks = ${ENVBOOKS}\\nMovies = ${ENVMOVIES}\\nMusic = ${ENVMUSIC}\\nTV = ${ENVTV}\\n\\nThis will be passed into the applications.\\n\\nWould you like to accept this?" 17 78); then
reset || true
#TODO - Should we check if the folder exists?
#TODO - Should we set permissions on the folder?
- run_script 'env_set' 'MEDIADIR_BOOKS' "${DETECTED_HOMEDIR}/Books"
- run_script 'env_set' 'MEDIADIR_MOVIES' "${DETECTED_HOMEDIR}/Movies"
- run_script 'env_set' 'MEDIADIR_MUSIC' "${DETECTED_HOMEDIR}/Music"
- run_script 'env_set' 'MEDIADIR_TV' "${DETECTED_HOMEDIR}/TV"
+ run_script 'env_set' 'MEDIADIR_BOOKS' "${ENVBOOKS}"
+ run_script 'env_set' 'MEDIADIR_MOVIES' "${ENVMOVIES}"
+ run_script 'env_set' 'MEDIADIR_MUSIC' "${ENVMUSIC}"
+ run_script 'env_set' 'MEDIADIR_TV' "${ENVTV}"
else
- run_menu 'input_prompt' 'MEDIADIR_BOOKS' "${DETECTED_HOMEDIR}/Books"
- run_menu 'input_prompt' 'MEDIADIR_MOVIES' "${DETECTED_HOMEDIR}/Movies"
- run_menu 'input_prompt' 'MEDIADIR_MUSIC' "${DETECTED_HOMEDIR}/Music"
- run_menu 'input_prompt' 'MEDIADIR_TV' "${DETECTED_HOMEDIR}/TV"
+ run_menu 'input_prompt' 'MEDIADIR_BOOKS' "${ENVBOOKS}"
+ run_menu 'input_prompt' 'MEDIADIR_MOVIES' "${ENVMOVIES}"
+ run_menu 'input_prompt' 'MEDIADIR_MUSIC' "${ENVMUSIC}"
+ run_menu 'input_prompt' 'MEDIADIR_TV' "${ENVTV}"
fi
}

MODIFY
scripts/menus/timezone_set.sh
scripts/menus/timezone_set.sh
@@ -11,7 +11,7 @@ timezone_set() {
run_script 'env_set' 'TZ' "${CURRENTTIMEZONE}"
else
whiptail --title "Time Zone" --fb --yesno --yes-button "OK" --no-button "Cancel" \
- "Your Current Time Zone is: ${CURRENTTIMEZONE} \\nThis will be passed into the applications.\\n\\nIf this is incorrect cancel now and change your system time zone!" 12 78
+ "Your Current Time Zone is: ${CURRENTTIMEZONE}\\n\\nThis will be passed into the applications.\\n\\nIf this is incorrect cancel now and change your system time zone!" 13 78
reset || true
run_script 'env_set' 'TZ' "${CURRENTTIMEZONE}"
fi

GUI - Check .env file for set params