aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-04-14 11:39:26 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-04-14 11:39:26 +0200
commit00289ba3f0916523e76932cb4bba3cfcae00a9bc (patch)
tree2263fbccd6a6a400ff0f31ff04d341f77164b62e /scripts
parentb9e880f428dcbc3cc7ebe7abd1f5e19e985e5ef9 (diff)
Do not overwrite the data messages
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/i-data-messages.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/i-data-messages.sh b/scripts/i-data-messages.sh
index 4e71783..5ab631c 100755
--- a/scripts/i-data-messages.sh
+++ b/scripts/i-data-messages.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net>
+# SPDX-FileCopyrightText: 2023, 2024 Markus Uhlin <maxxe@rpblc.net>
# SPDX-License-Identifier: ISC
i_data_messages () {
@@ -24,8 +24,17 @@ welcome
for file in ${_files}; do
printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}"
+
if [ -r "${_src_prefix}/${file}" ]; then
+ if [ -r "${_dest}/${file}" ]; then
+ echo "already exists (not overwriting)"
+ diff -u -w \
+ "${_dest}/${file}" "${_src_prefix}/${file}"
+ continue
+ fi
+
install -m 0644 "${_src_prefix}/${file}" "${_dest}"
+
if [ $? -eq 0 ]; then
echo "ok"
else