Remove the bashism "source" and add a check before including the default
config file, because POSIX compliant shells would abort when a dot
script is not found.
-#!/bin/bash
+#!/bin/sh
#
# v4l2-settings-restore.sh - restore v4l2 device settings
#
[ "$DEBUG" = "true" ] && set -x
set -e
-source /etc/default/v4l2-persistent-settings || :
-
-: "${SETTINGS_DIR:=/tmp}"
+SETTINGS_DIR="/tmp"
+[ -f /etc/default/v4l2-persistent-settings ] && . /etc/default/v4l2-persistent-settings
SETTINGS_FILE="${SETTINGS_DIR}/${ID_V4L_PRODUCT}.conf"
-#!/bin/bash
+#!/bin/sh
#
# v4l2-settings-save.sh - save v4l2 device settings
#
DEVNAME="$1"
-source /etc/default/v4l2-persistent-settings || :
-
-: "${SETTINGS_DIR:=/tmp}"
+SETTINGS_DIR="/tmp"
+[ -f /etc/default/v4l2-persistent-settings ] && . /etc/default/v4l2-persistent-settings
: "${ID_V4L_PRODUCT:=$(v4l2-ctl -d "$DEVNAME" --info | grep "Card type" | cut -d ':' -f 2 | sed 's/^[[:space:]]//' | tr -d '\n')}"