Skip to content

Commit

Permalink
chore: changes install routine
Browse files Browse the repository at this point in the history
This should fix #52

make config is now optional.

Now it uses $HOME/printer_data/ as default.

Signed-off-by: Stephan Wendel <[email protected]>
  • Loading branch information
KwadFan committed Nov 10, 2022
1 parent 0eb04cf commit d407c68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/dev-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -Ee
# Global Vars
TITLE="\e[31mcrowsnest\e[0m - $(basename "${0}")"
DH_VERSION="v0.0.0"
[[ -n "${BASE_USER}" ]] || BASE_USER="$(whoami)"
[[ -n "${BASE_USER}" ]] || BASE_USER="$(logname)"

# Set fallback lang
export LC_ALL=C
Expand Down
18 changes: 12 additions & 6 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -Ee

# Global Vars
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_DEFAULT_CONF}" ]] || CROWSNEST_DEFAULT_CONF="resources/crowsnest.conf"

Expand Down Expand Up @@ -55,8 +55,8 @@ welcome_msg() {

### Config Message
config_msg() {
echo -e "\nConfig file not found!\n\tYOU NEED TO CREATE A CONFIGURATION!"
echo -e "\tPlease use 'make config' first!\nExiting..."
echo -e "\nConfig file not found!\n\tUsing defaults ..."
echo -e "\tThis uses paths located in 'printer_data' of your Home Folder."
exit 1
}

Expand Down Expand Up @@ -112,9 +112,15 @@ import_config() {
# shellcheck disable=SC1091
source tools/.config
return 0
else
config_msg
return 0
fi
if [[ ! -f tools/.config ]] &&
[[ "${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
}

Expand Down

0 comments on commit d407c68

Please sign in to comment.