summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_upgrader')
-rw-r--r--satellit_upgrader/updater.template.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index 99641a0..37ccb35 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -129,6 +129,20 @@ diffcp () {
return 0
}
+# install_files <module>
+# returns 0 (true) if at least one file was copied
+install_files () {
+ local SRC="$FILEDIR/$1"
+ local files file ret
+ [ -d "$SRC" ] || perror "NO SUCH DIRECTORY: $SRC"
+ readarray -t -d '' files < <( find "$SRC" -type f -print0 )
+ ret=1
+ for file in "${files[@]}"; do
+ diffcp "$1" "${file#$SRC}" && ret=0
+ done
+ return $ret
+}
+
# failprint apt-get install foobar
# Only prints command output to stdout if exit code is not 0
failprint () {