Module now uses "make install" Added new Option in config: CROWSNEST_FORCE_RASPICAMFIX="[y|n]" The Installer ignores to implement Raspicamfix due qemu environment. Choose "y" to force install of fix. Works only with Raspberry SBC's! Signed-off-by: Stephan Wendel <me@stephanwe.de>
56 lines
1.8 KiB
Bash
56 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
#### webcamd - A webcam Service for multiple Cams and Stream Services.
|
|
####
|
|
#### Written by Stephan Wendel aka KwadFan <me@stephanwe.de>
|
|
#### Copyright 2021
|
|
#### https://github.com/mainsail-crew/crowsnest
|
|
####
|
|
#### This File is distributed under GPLv3
|
|
####
|
|
|
|
# shellcheck disable=all
|
|
|
|
# Error handling
|
|
# set -x # Uncomment for debugging purposes
|
|
set -e
|
|
|
|
source /common.sh
|
|
install_cleanup_trap
|
|
|
|
echo_green "Installing crowsnest and enable webcam Service ..."
|
|
# install dependencies
|
|
# force apt update
|
|
apt update
|
|
check_install_pkgs ${CROWSNEST_CROWSNEST_DEPS}
|
|
# Move to $HOME dir
|
|
pushd /home/${BASE_USER} &> /dev/null || exit 1
|
|
# make sure config folder exist
|
|
if [ ! -d "${CROWSNEST_DEFAULT_CONF_DIR}" ]; then
|
|
sudo -u "${BASE_USER}" mkdir -p "${CROWSNEST_DEFAULT_CONF_DIR}"
|
|
fi
|
|
# clone Repo
|
|
echo_green "Clone crowsnest repository ..."
|
|
gitclone CROWSNEST_CROWSNEST_REPO crowsnest
|
|
# install crowsnest
|
|
pushd /home/${BASE_USER}/crowsnest &> /dev/null || exit 1
|
|
echo_green "Running crowsnest installer ..."
|
|
sudo -u "${BASE_USER}" make install
|
|
# add update manager section to moonraker.conf
|
|
if [ -f "/home/${BASE_USER}/klipper_config/moonraker.conf" ] &&
|
|
[ "${CROWSNEST_MOONRAKER_SUPPORT}" == "y" ]; then
|
|
sudo -u ${BASE_USER} \
|
|
sh -c 'echo -e "\n" >> /home/$(whoami)/klipper_config/moonraker.conf'
|
|
sudo -u ${BASE_USER} \
|
|
sh -c 'cat file_templates/moonraker_update.txt \
|
|
>> /home/$(whoami)/klipper_config/moonraker.conf'
|
|
fi
|
|
if [ "${CROWSNEST_FORCE_RASPICAMFIX}" == "y" ]; then
|
|
echo -en "Applying Raspicam Fix ... \r"
|
|
sudo sh -c 'echo "bcm2835-v4l2" >> /etc/modules'
|
|
sudo cp file_templates/bcm2835-v4l2.conf /etc/modprobe.d/
|
|
echo -e "Applying Raspicam Fix ... [OK]"
|
|
fi
|
|
popd &> /dev/null || exit 1
|
|
popd &> /dev/null || exit 1
|