projects
/
v4l2-persistent-settings.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
v4l2-settings-restore.sh: don't use "echo -n"
[v4l2-persistent-settings.git]
/
v4l2-settings-restore.sh
diff --git
a/v4l2-settings-restore.sh
b/v4l2-settings-restore.sh
index
bae3450
..
cb6b572
100755
(executable)
--- a/
v4l2-settings-restore.sh
+++ b/
v4l2-settings-restore.sh
@@
-1,4
+1,4
@@
-#!/bin/
ba
sh
+#!/bin/sh
#
# v4l2-settings-restore.sh - restore v4l2 device settings
#
#
# v4l2-settings-restore.sh - restore v4l2 device settings
#
@@
-15,9
+15,8
@@
[ "$DEBUG" = "true" ] && set -x
set -e
[ "$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"
SETTINGS_FILE="${SETTINGS_DIR}/${ID_V4L_PRODUCT}.conf"
@@
-25,8
+24,8
@@
if [ "$ACTION" = "add" ] && [ -f "$SETTINGS_FILE" ];
then
while read -r setting;
do
then
while read -r setting;
do
- CTRL=$(echo
-n "$setting"
| cut -d ' ' -f 1)
- VAL=$(echo
-n "$setting"
| cut -d ' ' -f 2)
+ CTRL=$(echo
"$setting" | tr -d '\n'
| cut -d ' ' -f 1)
+ VAL=$(echo
"$setting" | tr -d '\n'
| cut -d ' ' -f 2)
v4l2-ctl -d "$DEVNAME" --set-ctrl "${CTRL}=${VAL}"
done < "$SETTINGS_FILE"
fi
v4l2-ctl -d "$DEVNAME" --set-ctrl "${CTRL}=${VAL}"
done < "$SETTINGS_FILE"
fi