add messaging and exit earlier
This commit is contained in:
parent
7a5896acfa
commit
cf0032d667
1 changed files with 23 additions and 19 deletions
|
@ -27,27 +27,31 @@ then
|
||||||
sed_cmd="$sed_cmd --regexp-extended"
|
sed_cmd="$sed_cmd --regexp-extended"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! echo "$script" \
|
if echo "$script" \
|
||||||
| "$sed_cmd" -f - "$file_from_target" \
|
| "$sed_cmd" -f - "$file_from_target" \
|
||||||
| diff "$file_from_target" - \
|
| diff "$file_from_target" - \
|
||||||
> /dev/null
|
> /dev/null
|
||||||
then
|
then
|
||||||
# shellcheck disable=SC2016
|
exit 0
|
||||||
echo 'tmp="$( mktemp )"'
|
fi
|
||||||
|
|
||||||
echo "$sed_cmd -f - '$file' > \"\$tmp\" << EOF"
|
# shellcheck disable=SC2016
|
||||||
|
echo 'tmp="$( mktemp )"'
|
||||||
echo "$script"
|
|
||||||
|
echo "$sed_cmd -f - '$file' > \"\$tmp\" << EOF"
|
||||||
echo 'EOF'
|
|
||||||
|
echo "$script"
|
||||||
echo "cp \"\$tmp\" '$file'"
|
|
||||||
|
echo 'EOF'
|
||||||
# shellcheck disable=SC2016
|
|
||||||
echo 'rm -f "$tmp"'
|
echo "cp \"\$tmp\" '$file'"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/onchange" ]
|
# shellcheck disable=SC2016
|
||||||
then
|
echo 'rm -f "$tmp"'
|
||||||
cat "$__object/parameter/onchange"
|
|
||||||
fi
|
echo 'change' >> "$__messages_out"
|
||||||
|
|
||||||
|
if [ -f "$__object/parameter/onchange" ]
|
||||||
|
then
|
||||||
|
cat "$__object/parameter/onchange"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue