chore: changes install routine

This should fix https://github.com/mainsail-crew/crowsnest/issues/52

make config is now optional.

Now it uses $HOME/printer_data/ as default.

Signed-off-by: Stephan Wendel <me@stephanwe.de>
This commit is contained in:
Stephan Wendel 2022-11-10 20:52:43 +01:00
parent 0eb04cf2a6
commit d407c683c0
No known key found for this signature in database
GPG Key ID: F465B83ACBA45639
2 changed files with 13 additions and 7 deletions

View File

@ -20,7 +20,7 @@ set -Ee
# Global Vars # Global Vars
TITLE="\e[31mcrowsnest\e[0m - $(basename "${0}")" TITLE="\e[31mcrowsnest\e[0m - $(basename "${0}")"
DH_VERSION="v0.0.0" DH_VERSION="v0.0.0"
[[ -n "${BASE_USER}" ]] || BASE_USER="$(whoami)" [[ -n "${BASE_USER}" ]] || BASE_USER="$(logname)"
# Set fallback lang # Set fallback lang
export LC_ALL=C export LC_ALL=C

View File

@ -19,7 +19,7 @@ set -Ee
# Global Vars # Global Vars
TITLE="\e[31mcrowsnest\e[0m - A webcam daemon for multiple Cams and stream services." TITLE="\e[31mcrowsnest\e[0m - A webcam daemon for multiple Cams and stream services."
[[ -n "${BASE_USER}" ]] || BASE_USER="$(whoami)" [[ -n "${BASE_USER}" ]] || BASE_USER="$(logname)"
[[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0" [[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0"
[[ -n "${CROWSNEST_DEFAULT_CONF}" ]] || CROWSNEST_DEFAULT_CONF="resources/crowsnest.conf" [[ -n "${CROWSNEST_DEFAULT_CONF}" ]] || CROWSNEST_DEFAULT_CONF="resources/crowsnest.conf"
@ -55,8 +55,8 @@ welcome_msg() {
### Config Message ### Config Message
config_msg() { config_msg() {
echo -e "\nConfig file not found!\n\tYOU NEED TO CREATE A CONFIGURATION!" echo -e "\nConfig file not found!\n\tUsing defaults ..."
echo -e "\tPlease use 'make config' first!\nExiting..." echo -e "\tThis uses paths located in 'printer_data' of your Home Folder."
exit 1 exit 1
} }
@ -112,9 +112,15 @@ import_config() {
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source tools/.config source tools/.config
return 0 return 0
else fi
config_msg if [[ ! -f tools/.config ]] &&
return 0 [[ "${CROWSNEST_UNATTENDED}" != "1" ]]; then
CROWSNEST_CONFIG_PATH="/home/${BASE_USER}/printer_data/config"
CROWSNEST_LOG_PATH="/home/${BASE_USER}/printer_data/logs"
CROWSNEST_ENV_PATH="/home/${BASE_USER}/printer_data/systemd"
CROWSNEST_USTREAMER_REPO_SHIP="https://github.com/pikvm/ustreamer.git"
CROWSNEST_USTREAMER_REPO_BRANCH="master"
fi fi
} }