diff --git a/bin/build.sh b/bin/build.sh index 96ca1990..38bb029e 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -47,6 +47,7 @@ if [[ -z "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" ]]; then CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="master" fi + # Paths of repos ALL_PATHS=( "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" @@ -67,7 +68,7 @@ show_help() { ### Check if device is Raspberry Pi is_raspberry_pi() { if [[ -f /proc/device-tree/model ]] && - grep -q "Raspberry" /proc/device-tree/model; then + grep -q "Raspberry" /proc/device-tree/model; then echo "1" else echo "0" @@ -76,13 +77,13 @@ is_raspberry_pi() { is_bookworm() { if [[ -f /etc/os-release ]]; then - grep -cq "bookworm" /etc/os-release &>/dev/null && echo "1" || echo "0" + grep -cq "bookworm" /etc/os-release &> /dev/null && echo "1" || echo "0" fi } is_pi5() { if [[ -f /proc/device-tree/model ]] && - grep -q "Raspberry Pi 5" /proc/device-tree/model; then + grep -q "Raspberry Pi 5" /proc/device-tree/model; then echo "1" else echo "0" @@ -91,7 +92,7 @@ is_pi5() { is_ubuntu_arm() { if [[ "$(is_raspberry_pi)" = "1" ]] && - grep -q "ubuntu" /etc/os-release; then + grep -q "ubuntu" /etc/os-release; then echo "1" else echo "0" @@ -142,10 +143,10 @@ clone_cstreamer() { ## Special handling because only supported on Raspberry Pi [[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0" if { [[ "$(is_raspberry_pi)" = "0" ]] || - [[ "$(is_pi5)" = "1" ]] || - [[ "$(is_ubuntu_arm)" = "1" ]] || - [[ "$(is_armbian)" = "1" ]]; } && - [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then + [[ "$(is_pi5)" = "1" ]] || + [[ "$(is_ubuntu_arm)" = "1" ]] || + [[ "$(is_armbian)" = "1" ]]; } && + [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then printf "Device is not supported! Cloning camera-streamer ... [SKIPPED]\n" return fi @@ -178,11 +179,11 @@ clean_apps() { for app in "${ALL_PATHS[@]}"; do if [[ ! -d "${app}" ]]; then printf "'%s' does not exist! Clean ... [SKIPPED]\n" "${app}" - else + else printf "\nRunning 'make clean' in %s ... \n" "${app}" - pushd "${app}" &>/dev/null || exit 1 + pushd "${app}" &> /dev/null || exit 1 make clean - popd &>/dev/null || exit 1 + popd &> /dev/null || exit 1 fi done printf "\nRunning 'make clean' ... [DONE]\n" @@ -204,9 +205,9 @@ build_apps() { fi if [[ -d "${path}" ]]; then printf "Build '%s' using ${USE_PROCS##-j} Cores ... \n" "${path##*/}" - pushd "${path}" &>/dev/null || exit 1 + pushd "${path}" &> /dev/null || exit 1 make "${USE_PROCS}" - popd &>/dev/null || exit 1 + popd &> /dev/null || exit 1 printf "Build '%s' ... [SUCCESS]\n" "${path##*/}" fi done @@ -229,31 +230,31 @@ main() { ## Get opts while true; do case "${1}" in - -b | --build) - build_apps - break + -b|--build) + build_apps + break ;; - -c | --clean) - clean_apps - break + -c|--clean) + clean_apps + break ;; - -d | --delete) - delete_apps - break + -d|--delete) + delete_apps + break ;; - -h | --help) - show_help - break + -h|--help) + show_help + break ;; - -r | --reclone) - delete_apps - clone_apps - break + -r|--reclone) + delete_apps + clone_apps + break ;; - *) - printf "Unknown option: %s" "${1}" - show_help - break + *) + printf "Unknown option: %s" "${1}" + show_help + break ;; esac done diff --git a/libs/core.sh b/libs/core.sh index 2ab536b8..8d6bc552 100755 --- a/libs/core.sh +++ b/libs/core.sh @@ -18,9 +18,9 @@ set -Ee ## Version of crowsnest function self_version { - pushd "${BASE_CN_PATH}" &>/dev/null + pushd "${BASE_CN_PATH}" &> /dev/null git describe --always --tags - popd &>/dev/null + popd &> /dev/null } # Init Traps @@ -96,9 +96,9 @@ function check_apps { ## Avoid dependency check if non rpi sbc if [[ "$(is_raspberry_pi)" = "1" ]] && - [[ "$(is_ubuntu_arm)" = "0" ]] && - [[ "$(is_armbian)" = "0" ]] && - [[ "$(is_pi5)" = "0" ]]; then + [[ "$(is_ubuntu_arm)" = "0" ]] && + [[ "$(is_armbian)" = "0" ]] && + [[ "$(is_pi5)" = "0" ]]; then if [[ -x "${BASE_CN_PATH}/${cstreamer}" ]]; then log_msg "Dependency: '${cstreamer##*/}' found in ${cstreamer}." else diff --git a/libs/hwhandler.sh b/libs/hwhandler.sh index 80a28c2e..06181c8a 100755 --- a/libs/hwhandler.sh +++ b/libs/hwhandler.sh @@ -19,7 +19,7 @@ set -Ee ### Detect Hardware detect_avail_cams() { local avail realpath - avail="$(find /dev/v4l/by-id/ -iname "*index0" 2>/dev/null)" + avail="$(find /dev/v4l/by-id/ -iname "*index0" 2> /dev/null)" count="$(echo "${avail}" | wc -l)" if [[ -d "/dev/v4l/by-id/" ]] && [[ -n "${avail}" ]]; then log_msg "INFO: Found ${count} available v4l2 (UVC) camera(s)" @@ -43,7 +43,7 @@ list_cam_formats() { prefix="$(date +'[%D %T]') crowsnest:" log_msg "Supported Formats:" while read -r i; do - printf "%s\t\t%s\n" "${prefix}" "${i}" >>"${CROWSNEST_LOG_PATH}" + printf "%s\t\t%s\n" "${prefix}" "${i}" >> "${CROWSNEST_LOG_PATH}" done < <(v4l2-ctl -d "${device}" --list-formats-ext | sed '1,3d') } @@ -53,7 +53,7 @@ list_cam_v4l2ctrls() { prefix="$(date +'[%D %T]') crowsnest:" log_msg "Supported Controls:" while read -r i; do - printf "%s\t\t%s\n" "${prefix}" "${i}" >>"${CROWSNEST_LOG_PATH}" + printf "%s\t\t%s\n" "${prefix}" "${i}" >> "${CROWSNEST_LOG_PATH}" done < <(v4l2-ctl -d "${device}" --list-ctrls-menus) } @@ -61,7 +61,7 @@ list_cam_v4l2ctrls() { detect_libcamera() { local avail if [[ "$(is_raspberry_pi)" = "1" ]] && - [[ -x "$(command -v libcamera-hello)" ]]; then + [[ -x "$(command -v libcamera-hello)" ]]; then avail="$(libcamera-hello --list-cameras | grep -c "Available" || echo "0")" if [[ "${avail}" = "1" ]]; then get_libcamera_path | wc -l @@ -76,9 +76,9 @@ detect_libcamera() { ## Spit /base/soc path for libcamera device get_libcamera_path() { if [[ "$(is_raspberry_pi)" = "1" ]] && - [[ -x "$(command -v libcamera-hello)" ]]; then - libcamera-hello --list-cameras | sed '1,2d' | - grep "\(/base/*\)" | cut -d"(" -f2 | tr -d '$)' + [[ -x "$(command -v libcamera-hello)" ]]; then + libcamera-hello --list-cameras | sed '1,2d' \ + | grep "\(/base/*\)" | cut -d"(" -f2 | tr -d '$)' fi } @@ -88,22 +88,22 @@ list_picam_resolution() { prefix="$(date +'[%D %T]') crowsnest:" log_msg "'libcamera' device(s) resolution(s) :" while IFS= read -r i; do - printf "%s\t\t%s\n" "${prefix}" "${i}" >>"${CROWSNEST_LOG_PATH}" + printf "%s\t\t%s\n" "${prefix}" "${i}" >> "${CROWSNEST_LOG_PATH}" done < <(libcamera-hello --list-cameras | sed '1,2d;s/Modes:/Colorspace:/') } get_libcamera_controls() { local ust_bin flags - flags=(--camera-type=libcamera --camera-list_options) + flags=( --camera-type=libcamera --camera-list_options ) ust_bin="${BASE_CN_PATH}/bin/camera-streamer/camera-streamer" if [[ -x "${ust_bin}" ]]; then - "${ust_bin}" "${flags[@]}" --camera-path="$(get_libcamera_path)" 2>/dev/null | - sed 's/device//g;/^SNAPSHOT/q' | sed '/^SNAPSHOT/d' | - sed '/^CAMERA/d;/- property/d' | sed '/camera-streamer Version:/d' | - sed 's/- available option: //g' | sed '/^$/d;' | - sed 's/([0-9]*[a-z,0-9]\, /(/g' | sed '/type=7/d;/type=4/d;/type=Rectangle/d' | - sed 's/type=1/bool/g;s/type=3/int/g;s/type=5/float/g' | sed 's/type=//g;' | - sed 's/\[/min=/g;s/\.\./ max=/g;s/\]$//g' + "${ust_bin}" "${flags[@]}" --camera-path="$(get_libcamera_path)" 2> /dev/null | \ + sed 's/device//g;/^SNAPSHOT/q' | sed '/^SNAPSHOT/d' | \ + sed '/^CAMERA/d;/- property/d' | sed '/camera-streamer Version:/d' | \ + sed 's/- available option: //g' | sed '/^$/d;' | \ + sed 's/([0-9]*[a-z,0-9]\, /(/g' | sed '/type=7/d;/type=4/d;/type=Rectangle/d' | \ + sed 's/type=1/bool/g;s/type=3/int/g;s/type=5/float/g' | sed 's/type=//g;' | \ + sed 's/\[/min=/g;s/\.\./ max=/g;s/\]$//g' else log_msg "WARN: 'libcamera' device option can not be displayed, because" log_msg "WARN: camera-streamer is not installed" @@ -127,17 +127,17 @@ list_picam_controls() { function detect_legacy { local avail if [[ "$(is_raspberry_pi)" = "1" ]] && - command -v vcgencmd &>/dev/null; then - if vcgencmd get_camera &>/dev/null; then - avail="$(vcgencmd get_camera | awk -F '=' '{ print $3 }' | cut -d',' -f1)" + command -v vcgencmd &> /dev/null; then + if vcgencmd get_camera &> /dev/null; then + avail="$( vcgencmd get_camera | awk -F '=' '{ print $3 }' | cut -d',' -f1)" fi fi echo "${avail:-0}" } function dev_is_legacy { - v4l2-ctl --list-devices | grep -A1 -e 'mmal' | - awk 'NR==2 {print $1}' + v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \ + awk 'NR==2 {print $1}' } ## Determine if cam has H.264 Hardware encoder @@ -161,7 +161,7 @@ detect_mjpeg() { ## Check if device is raspberry sbc is_raspberry_pi() { if [[ -f /proc/device-tree/model ]] && - grep -q "Raspberry" /proc/device-tree/model; then + grep -q "Raspberry" /proc/device-tree/model; then echo "1" else echo "0" @@ -170,7 +170,7 @@ is_raspberry_pi() { is_pi5() { if [[ -f /proc/device-tree/model ]] && - grep -q "Raspberry Pi 5" /proc/device-tree/model; then + grep -q "Raspberry Pi 5" /proc/device-tree/model; then echo "1" else echo "0" @@ -179,7 +179,7 @@ is_pi5() { is_ubuntu_arm() { if [[ "$(is_raspberry_pi)" = "1" ]] && - grep -q "ubuntu" /etc/os-release; then + grep -q "ubuntu" /etc/os-release; then echo "1" else echo "0" diff --git a/libs/init_stream.sh b/libs/init_stream.sh index f825ef05..bb01da5a 100755 --- a/libs/init_stream.sh +++ b/libs/init_stream.sh @@ -26,24 +26,24 @@ function construct_streamer { mode="$(get_param "cam ${cams}" mode)" check_section "${cams}" case ${mode} in - [mM]ulti | camera-streamer) - if [[ "$(is_raspberry_pi)" = "1" ]] && + [mM]ulti | camera-streamer) + if [[ "$(is_raspberry_pi)" = "1" ]] && [[ "$(is_ubuntu_arm)" = "0" ]] && [[ "$(is_armbian)" = "0" ]] && [[ "$(is_pi5)" = "0" ]]; then - MULTI_INSTANCES+=("${cams}") - else - log_msg "WARN: Mode 'camera-streamer' is not supported on your device!" - log_msg "WARN: Falling back to Mode 'ustreamer'" - MJPG_INSTANCES+=("${cams}") - fi + MULTI_INSTANCES+=( "${cams}" ) + else + log_msg "WARN: Mode 'camera-streamer' is not supported on your device!" + log_msg "WARN: Falling back to Mode 'ustreamer'" + MJPG_INSTANCES+=( "${cams}" ) + fi ;; - mjpg | mjpeg | ustreamer) - MJPG_INSTANCES+=("${cams}") + mjpg | mjpeg | ustreamer) + MJPG_INSTANCES+=( "${cams}" ) ;; - ? | *) - unknown_mode_msg - MJPG_INSTANCES+=("${cams}") + ?|*) + unknown_mode_msg + MJPG_INSTANCES+=( "${cams}" ) ;; esac @@ -54,8 +54,6 @@ function construct_streamer { if [ "${#MJPG_INSTANCES[@]}" != "0" ]; then run_mjpg "${MJPG_INSTANCES[*]}" fi - sleep 2 & - sleep_pid="$!" - wait "${sleep_pid}" + sleep 2 & sleep_pid="$!" ; wait "${sleep_pid}" log_msg " ... Done!" } diff --git a/libs/versioncontrol.sh b/libs/versioncontrol.sh index e9b08417..a1a2b727 100644 --- a/libs/versioncontrol.sh +++ b/libs/versioncontrol.sh @@ -26,35 +26,36 @@ versioncontrol() { get_ustreamer_version() { local cur_ver avail_ver - pushd "${BASE_CN_PATH}"/bin/ustreamer &>/dev/null || exit 1 - avail_ver="$(git describe --tags --always)" - cur_ver="v$(${UST_BIN} -v)" - if [[ "${cur_ver}" == "${avail_ver}" ]]; then - vc_log_msg "ustreamer is up to date. (${cur_ver})" - fi - if [[ "${cur_ver}" != "${avail_ver}" ]]; then - vc_log_msg "ustreamer new version available: ${avail_ver} (${cur_ver})." - fi - popd &>/dev/null || exit 1 + pushd "${BASE_CN_PATH}"/bin/ustreamer &> /dev/null || exit 1 + avail_ver="$(git describe --tags --always)" + cur_ver="v$(${UST_BIN} -v)" + if [[ "${cur_ver}" == "${avail_ver}" ]]; then + vc_log_msg "ustreamer is up to date. (${cur_ver})" + fi + if [[ "${cur_ver}" != "${avail_ver}" ]]; then + vc_log_msg "ustreamer new version available: ${avail_ver} (${cur_ver})." + fi + popd &> /dev/null || exit 1 } + # Camera Streamer has no version Output yet get_ayucamstream_version() { local cur_ver avail_ver if [[ "$(is_raspberry_pi)" = "1" ]] && - [[ "$(is_ubuntu_arm)" = "0" ]] && - [[ "$(is_armbian)" = "0" ]] && - [[ "$(is_pi5)" = "0" ]]; then - pushd "${BASE_CN_PATH}"/bin/camera-streamer &>/dev/null || exit 1 - avail_ver="($(git describe --tags --always))" - cur_ver="$("${PWD}"/camera-streamer --version | tr -d " ")" - if [ "${cur_ver}" == "${avail_ver}" ]; then - vc_log_msg "camera-streamer is up to date. (${cur_ver})" - fi - if [ "${cur_ver}" != "${avail_ver}" ]; then - vc_log_msg "camera-streamer new version available: ${avail_ver} (${cur_ver})." - fi - popd &>/dev/null || exit 1 + [[ "$(is_ubuntu_arm)" = "0" ]] && + [[ "$(is_armbian)" = "0" ]] && + [[ "$(is_pi5)" = "0" ]]; then + pushd "${BASE_CN_PATH}"/bin/camera-streamer &> /dev/null || exit 1 + avail_ver="($(git describe --tags --always))" + cur_ver="$("${PWD}"/camera-streamer --version | tr -d " ")" + if [ "${cur_ver}" == "${avail_ver}" ]; then + vc_log_msg "camera-streamer is up to date. (${cur_ver})" + fi + if [ "${cur_ver}" != "${avail_ver}" ]; then + vc_log_msg "camera-streamer new version available: ${avail_ver} (${cur_ver})." + fi + popd &> /dev/null || exit 1 fi } diff --git a/tools/libs/core.sh b/tools/libs/core.sh index 87c68554..691b5342 100755 --- a/tools/libs/core.sh +++ b/tools/libs/core.sh @@ -22,7 +22,7 @@ set -Ee ## Funcs get_os_version() { if [[ -n "${1}" ]]; then - grep -c "${1}" /etc/os-release &>/dev/null && echo "1" || echo "0" + grep -c "${1}" /etc/os-release &> /dev/null && echo "1" || echo "0" fi } @@ -32,13 +32,13 @@ get_host_arch() { is_buster() { if [[ -f /etc/os-release ]]; then - grep -cq "buster" /etc/os-release &>/dev/null && echo "1" || echo "0" + grep -cq "buster" /etc/os-release &> /dev/null && echo "1" || echo "0" fi } is_bookworm() { if [[ -f /etc/os-release ]]; then - grep -cq "bookworm" /etc/os-release &>/dev/null && echo "1" || echo "0" + grep -cq "bookworm" /etc/os-release &> /dev/null && echo "1" || echo "0" fi } @@ -60,7 +60,7 @@ is_dietpi() { is_raspberry_pi() { if [[ -f /proc/device-tree/model ]] && - grep -q "Raspberry" /proc/device-tree/model; then + grep -q "Raspberry" /proc/device-tree/model; then echo "1" else echo "0" @@ -69,7 +69,7 @@ is_raspberry_pi() { is_pi5() { if [[ -f /proc/device-tree/model ]] && - grep -q "Raspberry Pi 5" /proc/device-tree/model; then + grep -q "Raspberry Pi 5" /proc/device-tree/model; then echo "1" else echo "0" @@ -78,7 +78,7 @@ is_pi5() { is_ubuntu_arm() { if [[ "$(is_raspberry_pi)" = "1" ]] && - grep -q "ubuntu" /etc/os-release; then + grep -q "ubuntu" /etc/os-release; then echo "1" else echo "0" @@ -95,7 +95,7 @@ is_armbian() { is_speederpad() { if grep -q "Ubuntu 20.04." /etc/os-release && - [[ "$(uname -rm)" = "4.9.191 aarch64" ]]; then + [[ "$(uname -rm)" = "4.9.191 aarch64" ]]; then echo "1" else echo "0" @@ -103,7 +103,7 @@ is_speederpad() { } test_load_module() { - if modprobe -n "${1}" &>/dev/null; then + if modprobe -n "${1}" &> /dev/null; then echo 1 else echo 0 @@ -169,11 +169,11 @@ shallow_cs_dependencies_check() { } link_pkglist_rpi() { - sudo -u "${BASE_USER}" ln -sf "${SRC_DIR}/libs/pkglist-rpi.sh" "${SRC_DIR}/pkglist.sh" &>/dev/null || return 1 + sudo -u "${BASE_USER}" ln -sf "${SRC_DIR}/libs/pkglist-rpi.sh" "${SRC_DIR}/pkglist.sh" &> /dev/null || return 1 } link_pkglist_generic() { - sudo -u "${BASE_USER}" ln -sf "${SRC_DIR}/libs/pkglist-generic.sh" "${SRC_DIR}/pkglist.sh" &>/dev/null || return 1 + sudo -u "${BASE_USER}" ln -sf "${SRC_DIR}/libs/pkglist-generic.sh" "${SRC_DIR}/pkglist.sh" &> /dev/null || return 1 } run_apt_update() { @@ -236,9 +236,9 @@ install_service_file() { fi cp -f "${service_file}" "${target_dir}" sed -i 's|%USER%|'"${BASE_USER}"'|g;s|%ENV%|'"${CROWSNEST_ENV_PATH}/crowsnest.env"'|g' \ - "${target_dir}/crowsnest.service" + "${target_dir}/crowsnest.service" [[ -f "${target_dir}/crowsnest.service" ]] && - grep -q "${BASE_USER}" "${target_dir}/crowsnest.service" || return 1 + grep -q "${BASE_USER}" "${target_dir}/crowsnest.service" || return 1 } add_sleep_to_crowsnest_env() { @@ -257,7 +257,7 @@ install_env_file() { sudo -u "${BASE_USER}" cp -f "${env_file}" "${env_target}" sed -i "s|%CONFPATH%|${CROWSNEST_CONFIG_PATH}|" "${env_target}" [[ -f "${env_target}" ]] && - grep -q "${CROWSNEST_CONFIG_PATH}" "${env_target}" || return 1 + grep -q "${CROWSNEST_CONFIG_PATH}" "${env_target}" || return 1 } install_logrotate_conf() { @@ -267,7 +267,7 @@ install_logrotate_conf() { cp -rf "${logrotatefile}" /etc/logrotate.d/crowsnest sed -i "s|%LOGPATH%|${logpath}|g" /etc/logrotate.d/crowsnest [[ -f "/etc/logrotate.d/crowsnest" ]] && - grep -q "${logpath}" "/etc/logrotate.d/crowsnest" || return 1 + grep -q "${logpath}" "/etc/logrotate.d/crowsnest" || return 1 } backup_crowsnest_conf() { @@ -288,16 +288,16 @@ install_crowsnest_conf() { sudo -u "${BASE_USER}" cp -rf "${conf_template}" "${CROWSNEST_CONFIG_PATH}" sed -i "s|%LOGPATH%|${logpath}|g" "${CROWSNEST_CONFIG_PATH}/crowsnest.conf" [[ -f "${CROWSNEST_CONFIG_PATH}/crowsnest.conf" ]] && - grep -q "${logpath}" "${CROWSNEST_CONFIG_PATH}/crowsnest.conf" || return 1 + grep -q "${logpath}" "${CROWSNEST_CONFIG_PATH}/crowsnest.conf" || return 1 } enable_service() { - sudo systemctl enable crowsnest.service &>/dev/null || return 1 + sudo systemctl enable crowsnest.service &> /dev/null || return 1 } add_group_video() { if [[ "$(groups "${BASE_USER}" | grep -c video)" == "0" ]]; then - if usermod -aG video "${BASE_USER}" >/dev/null; then + if usermod -aG video "${BASE_USER}" > /dev/null; then status_msg "Add User ${BASE_USER} to group 'video' ..." "0" fi else @@ -313,7 +313,7 @@ dietpi_cs_settings() { if [[ "$(is_buster)" = "0" ]]; then if ! grep -q "camera_auto_detect=1" /boot/config.txt; then msg "\nAdd camera_auto_detect=1 to /boot/config.txt ...\n" - echo "camera_auto_detect=1" >>/boot/config.txt + echo "camera_auto_detect=1" >> /boot/config.txt fi fi } @@ -322,30 +322,29 @@ dietpi_cs_settings() { detect_existing_webcamd() { local disable msg "Checking for mjpg-streamer ...\n" - if [[ -x "/usr/local/bin/webcamd" ]] && [[ -d "/home/${BASE_USER}/mjpg-streamer" ]]; then + if [[ -x "/usr/local/bin/webcamd" ]] && [[ -d "/home/${BASE_USER}/mjpg-streamer" ]]; then msg "Found an existing mjpg-streamer installation!" msg "This should be stopped and disabled!" while true; do read -erp "Do you want to stop and disable existing 'webcamd'? (Y/n) " -i "Y" disable case "${disable}" in - y | Y | yes | Yes | YES) - msg "Stopping webcamd.service ..." - sudo systemctl stop webcamd.service &>/dev/null - status_msg "Stopping webcamd.service ..." "0" - - msg "\nDisabling webcamd.service ...\r" - sudo systemctl disable webcamd.service &>/dev/null - status_msg "Disabling webcamd.service ..." "0" - return + y|Y|yes|Yes|YES) + msg "Stopping webcamd.service ..." + sudo systemctl stop webcamd.service &> /dev/null + status_msg "Stopping webcamd.service ..." "0" + + msg "\nDisabling webcamd.service ...\r" + sudo systemctl disable webcamd.service &> /dev/null + status_msg "Disabling webcamd.service ..." "0" + return ;; - n | N | no | No | NO) - msg "\nYou should disable and stop webcamd to use crowsnest without problems!\n" - return - ;; - *) - msg "You answered '${disable}'! Invalid input ..." + n|N|no|No|NO) + msg "\nYou should disable and stop webcamd to use crowsnest without problems!\n" + return ;; + *) + msg "You answered '${disable}'! Invalid input ..." ;; esac done fi