From 055362956dc7f939cf30c8c1d41435056da700fd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 20 Apr 2021 10:52:45 +0200 Subject: [SSUS] diffcp: Bail out if source file is missing --- satellit_upgrader/updater.template.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'satellit_upgrader') 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 [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." -- cgit v1.2.3-55-g7522