summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-20 10:52:45 +0200
committerSimon Rettberg2021-04-20 14:11:29 +0200
commit055362956dc7f939cf30c8c1d41435056da700fd (patch)
treed30169b4805a13efd79e7829ff6bcef0d6cfac19
parent[SSPS] Fix/cleanup directory permission/owner setting (diff)
downloadsetup-scripts-055362956dc7f939cf30c8c1d41435056da700fd.tar.gz
setup-scripts-055362956dc7f939cf30c8c1d41435056da700fd.tar.xz
setup-scripts-055362956dc7f939cf30c8c1d41435056da700fd.zip
[SSUS] diffcp: Bail out if source file is missing
-rw-r--r--satellit_upgrader/updater.template.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index 420b1bc..99641a0 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -109,10 +109,11 @@ fixperms () {
# diffcp <module> <file> [message]
# diffcp "dnbd3" "/opt/openslx/foo.txt" ["Installing new foo file"]
+# return 0 (true) if the file was different and thus copied
diffcp () {
local SRC="$FILEDIR/$1/$2"
local DST="/$2"
- [ -e "$SRC" ] || return 1
+ [ -e "$SRC" ] || perror "$1/$2 not included in updater"
[ -f "$SRC" ] || perror "$1/$2 included in updater, but is not regular file."
if [ -e "$DST" ]; then
[ -f "$DST" ] || perror "$DST exists and is not a regular file, cannot replace."